[Stackless] Stackless / Networking

Richard Tew richard.m.tew at gmail.com
Wed Feb 21 08:28:16 CET 2007

On 2/21/07, ghazel at gmail.com <ghazel at gmail.com> wrote:
> > The problem I see is that the Twisted scheduled task
> > (a callback) ought to call schedule() to give other
> > tasklets a chance to run. I don't had a good mental
> > model of what is happening between between Twisted
> > callbacks and Stackless tasklets in this scenario.
> So you could approach it one of two obvious ways. Either you could have
> Twisted periodically call stackless.schedule(), on say a LoopingCall. This
> would work if your tasklets need to run every so often - you control the
> granularity of how often they run. Otherwise a scheduling Stackless tasklet
> could occasionally queue up an event to reschedule ( reactor.callLater(0,
> stackless.schedule)), and then call schedule() itself to let other tasklets
> run. The allows you to control the granularity in a tasklet instead of
> time-based.
> I use a third mechanism, which is that tasklets use channels to "block"
> until a deferred they're waiting on completes - the deferred is given a
> callback that sends the result back to the channel then calls
> stackless.schedule.

Hi Greg,

If it is possible for you to write an example which demonstrates how
others could do this, I would be happy to check it in with the rest of
the Stackless examples.

The same goes for your approach Andrew.


Stackless mailing list
Stackless at stackless.com

More information about the Stackless mailing list