Welcome! Log In Create A New Profile

Advanced

General LWP questions

Posted by iofthestorm 
General LWP questions
May 22, 2009 09:13AM
Hi,
So I'm finally on summer vacation now and want to get started with wii coding again. I want to do stuff with threads, and I found here that the "thread" subsystem stuff is actually lightweight processes, am I correct? Is this API based on anything, or is it from scratch for libogc?

I'm familiar with pthreads and it looks sort of similar, but I'm not sure the thread queue stuff is for. Can someone explain?

Finally, just in general, how does this stuff work? I thought the Wii didn't really have much of an OS, so where is the scheduler running? Is it part of libogc itself?

Oh, and is the scheduler preemptive, or do I have to manually make threads yield?



Edited 1 time(s). Last edit at 05/22/2009 11:44PM by iofthestorm.
Re: General LWP questions
May 24, 2009 12:45PM
The scheduler resides in libogc. In __lwp_sysinit() libogc creates two threads, one idle thread and one "main thread" which is the entry point to the application you're running.

When you call LWP_CreateThread, it initializes your thread as preemptive, although you can take control of threads using some of the other LWP_* functions. This is ALL in libogc and I don't know if it's all original code or what, but it's pretty complex and interesting.
Re: General LWP questions
May 25, 2009 05:28PM
It's all original code. Not original concepts, of course.
Sorry, only registered users may post in this forum.

Click here to login