I create a thread: the thread may use a lot of CPU time
globle var progressbar=0;
main()
{
create The thread;
while(progressbar!=100)
draw the progressbar
}
the thread like this:
Thread()
{
computing..
update progressbar value;//has process 10%
.......
computing..
update progressbar value;//has process 100%
}
I find it work fine on Windows,but it is dosen't work on PSP.
On PSP the main is freezing until the thread return .
I dont know why?
thx for your help.
The PSP does not do preemptive multithreading. The kernel will only switch threads when you call certain functions -- an easy way to ensure it can switch to a new thread is to call SDL_Delay(0) periodically.
jimparis wrote:The PSP does not do preemptive multithreading. The kernel will only switch threads when you call certain functions -- an easy way to ensure it can switch to a new thread is to call SDL_Delay(0) periodically.