forums.ps2dev.org Forum Index forums.ps2dev.org
Homebrew PS2, PSP & PS3 Development Discussions
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Threading

 
Post new topic   Reply to topic    forums.ps2dev.org Forum Index -> PSP Development
View previous topic :: View next topic  
Author Message
cwbowron



Joined: 06 May 2005
Posts: 76
Location: East Lansing, MI

PostPosted: Sun Jul 03, 2005 4:09 am    Post subject: Threading Reply with quote

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.
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    forums.ps2dev.org Forum Index -> PSP Development All times are GMT + 10 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group