[fpc-pascal] Use sleep in thread

Xiangrong Fang xrfang at gmail.com
Thu Feb 26 15:34:45 CET 2015


2015-02-26 21:53 GMT+08:00 Marco van de Voort <marcov at stack.nl>:

>
> No, basically a sleeping thread is marked in the scheduler as "do not
> schedule for nn
> ticks". The thread doesn't run to evaluate if it should contiue. That is
> the
> scheduler/kernel's task.
>
> ​That's even better. And the key point is, after nn ticks, it is
**AUTOMATICALLY** re-scheduled,
without the need of knowledge of other threads/processes running on the
system!

​This is the effect of a thread voluntarily gives up its cpu share, but not
let other thread to control its "fate". ​
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freepascal.org/pipermail/fpc-pascal/attachments/20150226/acca9570/attachment.html>


More information about the fpc-pascal mailing list