note
BrowserUk
<p>So, I'll quote from your own first link:
<blockquote><i>
A value of zero causes the thread to relinquish the remainder of its time slice to any other thread that is ready to run.
</i></blockquote>
<p>As I said <c>Sleep( 0 )</c> <b>always</b> relinquishes the remainder to the calling threads timeslice. Which is exactly all I stated.
<blockquote><i>
"ready to run" is the keyword,
</i></blockquote>
<p>Sure, if the only thread ready to run is the thread that just ran, then is will <i>be allocated a new timeslice</i> immediately; <b>but it still gave up its old one.</b>
<p>And in the context of the OPs problem, it means that the task clean up <b>will occur in a timely manner</b>. This because, each time the scheduler is entered, any ready-to-run, but lower priority threads will have their priority temporarily boosted.
<p>Thus, the lower priority task clean up will quickly be boosted to a priority where it is selected in preference to the polling threads, thus the lock will be cleared, allowing one of the polling threads to acquire the lock and the system will continue.
<P>(I'll also remind you that I said <i>"<b>or just</b> sleep 0"</i>; ie. indicating that <c>sleep 0;</c> would suffice; not that it would be optimal!)
<div class="pmsig"><div class="pmsig-171588">
<hr />
<font size=1 >
<div>With the rise and rise of 'Social' network sites: 'Computers are making people easier to use everyday'</div>
<div>Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.</div>
<div>"Science is about questioning the status quo. Questioning authority". </div>
<div>In the absence of evidence, opinion is indistinguishable from prejudice.
<p align=right> [http://thebottomline.cpaaustralia.com.au/|RIP Neil Armstrong]</p></div>
</font>
</div></div>div
1008652
1009077