[Stackless] stackless and system threads

Richard Tew richard.m.tew at gmail.com
Sat Feb 3 19:38:10 CET 2007


On 2/2/07, Andrew Dalke <dalke at dalkescientific.com> wrote:
> I'm working on my presentation for PyCon.  I've gotten to the
> section where I'm talking about blocking, and ways to handle
> blocking calls.
>
> I want to show how to have stackless work with system threads,
> as when dealing with functions which have no non-blocking solution.
>
...
>
> While it works, I don't like the busy loop.
>
> Any ideas?

For your example, it is the right thing to do.

It really should be documented explicitly that the scheduler will
exit if there are no tasklets running, which does not include
those blocked on channels.  Or not running in other forms.

I think people should be disuaded from treating the watchdog as
something that just runs until all tasklets are exhausted.  The
model we use at CCP where the watchdog is repeatedly run
and all tasklets are yielded out of it, to be readded in the next
run, feels right to me.  And if I were writing documentation about
Stackless I would explicitly discourage ever using the watchdog
by itself outside of some form of loop.

Cheers,
Richard.

_______________________________________________
Stackless mailing list
Stackless at stackless.com
http://www.stackless.com/mailman/listinfo/stackless



More information about the Stackless mailing list