[Stackless] Proposed modification WRT threading and scheduling
arnarbi at gmail.com
Wed Jan 9 11:02:36 CET 2008
On Jan 9, 2008 8:25 AM, Richard Tew <richard.m.tew at gmail.com> wrote:
> When the scheduler is run, when there are no remaining tasklets
> scheduled and there are other Python threads which are runnable, then
> the scheduler will not exit and will instead block indefinitely
> waiting for one of those threads to reawaken it. You can see this
> demonstrated in the attached script, where the main thread will block
> instead of exiting the scheduler.
> I'd like to make a change to Stackless to optionally disable this
> behaviour, perhaps an option which can be set on the stackless module,
> or a parameter to the 'stackless.run' function.
What do you mean by "disable this behaviour"? Would you make the
scheduler with no runnable tasklets busy-loop to poll for tasklets? If
so, the parameter you mention could be an integer, saying how many
milliseconds to sleep between polls, with the default value of 0
giving you the current blocking behaviour.
Or perhaps you have something different in mind?
More information about the Stackless