User: Password:
Subscribe / Log in / New account

Short sleeps suffering from slack

Short sleeps suffering from slack

Posted Feb 24, 2012 23:02 UTC (Fri) by giraffedata (subscriber, #1954)
In reply to: Short sleeps suffering from slack by Ben_P
Parent article: Short sleeps suffering from slack

What types of applications break when sleep(0) just returns? ...
I've seen so many poorly written programs "fix" concurrency problems with yields ...

It seems like you've answered your own question.

I have no trouble believing that these programs you've seen worked better after sleep(0) was added than before. Maybe it's just within a narrow field of application, but that may be the only field that matters. You might say these programs don't deserve to keep working, even in that narrow application, but you can't deny that making sleep() a no-op would do damage there.

(Log in to post comments)

Copyright © 2018, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds