Hi
> IIRC, it does a nasty busy-wait.
>
> I did implement another version of ThreadedRepeat some time ago to resolve 
> this problem but then forgot about it.  I could try to dig it up but changing 
> the Sleep will be good enough for now.  The effective difference between a 
> polling version with Sleep (with strictly positive wait time) and a blocking 
> version with locks will be practically indistinguishable for most users.
>   
Uhm I'm sorry but I still don't get it:

- Why does Thread.Sleep(0) uses so much CPU?
- What do the WaitForFinishing and WaitForFinishingSafe methods really do?

According to Jeffrey Ritchter the Thread.Sleep(0) command "tells the 
system that the calling thread
relinquishes the remainder of its time slice and forces the system to 
schedule another thread. However,
the system can reschedule the thread that just called /Sleep"./
Then my guess is that the high CPU utilization is caused by a continuous 
context switch to the thread
that's calling Thread.Sleep(0) to itself, because the other threads are 
suspended.

I have no clue for the second question though.

Julian

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"MbUnit.User" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/MbUnitUser?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to