[fpc-pascal] Use sleep in thread

Michael Schnell mschnell at lumino.de
Thu Feb 26 11:40:44 CET 2015

On 02/26/2015 11:33 AM, Henry Vermaak wrote:
> Blocking with an even will sleep until someone wakes you up, it's very 
> efficient. Using sleep() you will have to wake up, check if someone 
> needs you, go to sleep again, etc. This is obviously more inefficient.

We were talking about the overhead of a "sleep for n milliseconds" 
functionality itself, and not about waiting for some event.

Abusing it for polling of course is not what sleep is meant for.

Sleep is for granting the CPU for other processes for (at least) a 
predefined time.

See the mail of the original poster: this is what he asked for.


More information about the fpc-pascal mailing list