[Stackless] Advice on Writing a Stackless Reactor For Twisted

Andrew Francis andrewfr_ice at yahoo.com
Thu Jan 18 20:27:32 CET 2007

Hi Dave and Colleagues: 

> I'm certainly new at this so any guidance is greatly
> appreciated, although I  don't want to hijack
>Andrew's original query.

Dave, hijack away! Call me idealistic but I believe if
we pool our knowledge together and get Stackless
smoothly interoperating with Twisted, this is a big
win for everyone, especially newcomers to Stackless
that wish to do network stuff.

> In reading the API docs for t.i.task.LoopingCall()
> it sounds like this  relies on the Twisted
>application loop being the driver rather than Twisted

> itself being treated as a tasklet and 'ticked'
> elsewhere.  

I believe Twisted task.LoopingCall depends on the the
underlying reactor implementation - i.e poll(),
select(). Provided that Stackless and Twisted are
residing in the same thread, Twisted will effectively
drive Stackless since it becomes the bottleneck. If
Twisted blocks, Stackless grinds to a halt. I tried
making task.LoopingCalls to a function that would call
stackless.schedule(), hoping to get Stackless tasklets
that could run a chance. In simple examples this
seemed to worked. When I integrated this approach into
my processor, it failed on some cases. I received a
variety of errors ranging from 

why = getattr(selectable, method)()

to the system losing deferred calls. When I have time,
I would like to get down to the root cause of the
problems. It would help if I knew more about debugging
Twisted applications (it would be nice to get Manhole
running). When I come to think about it, it would help
if I could get a debugger to properly work on
Stackless programmes.


No need to miss a message. Get email on-the-go 
with Yahoo! Mail for Mobile. Get started.

Stackless mailing list
Stackless at stackless.com

More information about the Stackless mailing list