Skip to content.

logo Stackless Python


Personal tools
Views

History for Idioms

Description of the Busy Wait problem of Stackless Sleep
added:
((Richard: This is actually still busy sleep. The only way to make it truly not busy would be to put the system checks to sleep. Whether you centralize it or not without an actual block on execution, the code eats CPU. I propose that you put the sleep manager to sleep until the next waking Tasklet comes online, remove that, search for the next soonest wake, and go to sleep again. You will need to use a separate system thread to manage this execution since sleeping on the main thread would halt execution. Alternately, you could just tuck a small piece of code into this which granularizes the sleep at maybe .1 seconds. But it is a busy wait no matter what you do -- unless you break it off onto a separate thread))

 

Powered by Plone