cwbowron

Joined: 06 May 2005 Posts: 76 Location: East Lansing, MI
|
Posted: Sun Jul 03, 2005 4:09 am Post subject: Threading |
|
|
I'm working on pondering for pspChess which requires multiple threads. There's a post from TyRaNiD in this thread: http://forums.ps2dev.org/viewtopic.php?t=1594&start=0 which says:
| Quote: |
sceKernelCreateThread(const char *name, void *func, int initpriority, int stacksize, int extra1, int extra2). Extra 1 and 2 seem to almost always be zero it seems. Also bear in mind like the ps2 the psp seems to have co-operative threading which means you either need to call sceKernelRotateThreadReadyQueue to switch to the next thread or sleep etc. And priorities are lowest is highest ;) |
In my testing it appears that some calls such as sceDisplayWaitVblankStart and/or sceCtrlReadBufferPositive will give up the timeslice and switch to a different thread.
I've got everything mostly working, but I was wondering if anyone has more information on what is really going on? When I actually try to use the sceKernelThreadSleep functions and such I cannot get it to work, but by the use of sceDisplayWaitVblankStart and/or sceCtrlReadBufferPositive seems to switch threads correctly.
Thanks. |
|