<div dir="ltr"><div class="gmail_extra"><div>I presume most of the systems would make the sleeping thread to yield the execution time for other threads.<br></div><div>The questionable behavior might occur in case of  sleep(0); (should it yield the remaining time or just return immediately - up to the OS).<br></div><div>And multi-cpu might also do something different.<br></div><div><br></div><div>thanks,<br></div><div>Dmitry<br></div><div><br></div><br><div class="gmail_quote">On Wed, Feb 25, 2015 at 9:41 AM, Xiangrong Fang <span dir="ltr"><<a href="mailto:xrfang@gmail.com" target="_blank">xrfang@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div style="font-family:monospace,monospace;font-size:large">Hi All,</div><div style="font-family:monospace,monospace;font-size:large"><br></div><div style="font-family:monospace,monospace;font-size:large">Can I use Sleep() in a thread to give up cpu time to other threads running at the same time, so as to adjust the relative "niceness" of a group of workers working on the same subject (in which each thread take part of the whole task).</div><div style="font-family:monospace,monospace;font-size:large"><br></div><div style="font-family:monospace,monospace;font-size:large">Thanks!</div><span class="HOEnZb"><font color="#888888"><div style="font-family:monospace,monospace;font-size:large"><br></div><div style="font-family:monospace,monospace;font-size:large">Xiangrong</div></font></span></div>
<br>_______________________________________________<br>
fpc-pascal maillist  -  <a href="mailto:fpc-pascal@lists.freepascal.org">fpc-pascal@lists.freepascal.org</a><br>
<a href="http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal" target="_blank">http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal</a><br></blockquote></div><br></div></div>