[Stackless] Proposed modification WRT threading and scheduling

Arnar Birgisson arnarbi at gmail.com
Wed Jan 9 23:57:03 CET 2008


On Jan 9, 2008 8:14 PM, Jeff Senn <senn at maya.com> wrote:
> Since you have no idea that any other threads have anything to do with
> stackless (as in Richard's example) -- there is no reason for
> stackless.run() to
> act differently when there is 1 thread versus >1 threads.
>
> If .run() is going to return when there are no tasklets to run, then
> it should
> ALWAYS do that.  And I do believe that returning is the "correct"
> decision because it leaves
> the higher-level scheduling up to the implementor.  (You could, for
> instance as Arnar implies,
> wrap .run() in a loop with time.sleep())

I agree, keep the behavior consistent and leave it up to the caller of
run() to reinvoke if desired.

Arnar




More information about the Stackless mailing list