On 5/19/2021 9:53 AM, Henry Vermaak wrote:
On Wed, 19 May 2021 at 14:36, Travis Siegel via fpc-pascal
<fpc-pascal@lists.freepascal.org> wrote:
No doubt your sleep code works just fine.

I'm not saying the sleep command doesn't work.

I'm saying the sleep command doesn't release unused cpu cycles for other
threads/programs to use.
No, fpc uses nanosleep() inside sysutils.sleep() which is documented
to suspend execution (i.e. no busy waiting) so the kernel will switch
to another thread/process.

That's useful information.

I did run across nanosleep in my digging, but I wasn't aware the sleep command called it.

I'm still a (little) puzzled though, why there are so many different suspend/sleep modes in linux kernel implementations. They appear to do similar things, so perhaps it's just incremental differences, depending on what's trying to be accomplished, or maybe, under the hood, they all call the same routines, I can't really say, but it sure has been educational digging around to find answers.

_______________________________________________
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Reply via email to