[fpc-pascal] Use sleep in thread

Dmitry Boyarintsev skalogryz.lists at gmail.com
Wed Feb 25 15:47:29 CET 2015


I presume most of the systems would make the sleeping thread to yield the
execution time for other threads.
The questionable behavior might occur in case of  sleep(0); (should it
yield the remaining time or just return immediately - up to the OS).
And multi-cpu might also do something different.

thanks,
Dmitry


On Wed, Feb 25, 2015 at 9:41 AM, Xiangrong Fang <xrfang at gmail.com> wrote:

> Hi All,
>
> 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).
>
> Thanks!
>
> Xiangrong
>
> _______________________________________________
> fpc-pascal maillist  -  fpc-pascal at lists.freepascal.org
> http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freepascal.org/pipermail/fpc-pascal/attachments/20150225/05fa3ba3/attachment.html>


More information about the fpc-pascal mailing list