Some help with SetAlarm()

Discuss the development of software, tools, libraries and anything else that helps make ps2dev happen.

Moderators: cheriff, Herben

Post Reply
PrimeTime
Posts: 25
Joined: Thu Aug 19, 2004 7:49 pm

Some help with SetAlarm()

Post by PrimeTime »

Hi again,

I'm having trouble finding any documentation on the EE's SetAlarm.

I'm wondering if when an alarm is set, it will call it's callback function even if there is another thread currently running.

Could anyone give me an example of how SetAlarm is used, or at least describe the parameters. When I try to use this function, my program will throw an exception.

My goal is to use a callback function that will be triggered by the alarm to cycle through my created threads.

Thanks again,
Ryan
mrbrown
Site Admin
Posts: 1537
Joined: Sat Jan 17, 2004 11:24 am

Post by mrbrown »

The callback function is executed in the same context as DMAC and INTC interrupt handlers. You have a very small stack and you cannot execute the non "i" versions of kernel syscalls.

The only types of things you should be doing in your callback are signalling a semaphore or rotating the thread queue, IOW, the "i" versions of thread operations.
"He was warned..."
Post Reply