[Stackless] Twisted and Stackless Re: An idea for making

Andrew Francis andrewfr_ice at yahoo.com
Wed Sep 13 15:59:44 CEST 2006

Message: 3
Date: Tue, 05 Sep 2006 14:02:57 -0000
From: radix at twistedmatrix.com
Subject: Re: [Stackless] An idea for making Stackless
more naturally
To: stackless at stackless.com

AF>Richard, I haven't used deferred lists yet but I
AF>find the deferred work really well with Stackless. 
AF>At most, there are minor changes I would like to
AF>in Twisted to make it a bit neater to pass a
AF>channel, but that is not a Stackless problem.

Radix>You might want to check out 

Radix, I have seen that webpage. However I did not see
how it would solve my fundamental problem, my
application blocking indefinitely when waiting for an
incoming connection.  

To recap my problem, pretend one has the following

[C(0) | C(1) | C(n) | S(0)]

C - client (making a connection)
S - server (accepting a connection)
| - running in parallel

In this scenario, the S will block Twisted and the
Stackless VM (Bob Ippolito pointed this out). Blocking
cuts down on throughput. I don't see how Deferred help
here. However calls to TaskLoop that periodically call
a callback, which in turn, call stackless.schedule(),
giving waiting clients a chance to execute. Another
advantage is that I can use TaskLoop to run a proper

I have to admit there is there few changes I can think
of at the moment that are absolutely necessary to make
Twisted work with Stackless. This is a good thing.


I have mentioned this in previous e-mail, but I find a
good way to use Twisted with Stackless is to have
tasklets communicate with callbacks through a shared
channel. Perhaps this is obvious. However I find it
works nicely.


>From what I recalled (I have to the code), my life
would be made easier if callback handlers were passed
a reference to the web server class. This would make
it easier to pass a callback a channel, as opposed to
making the channel a class variable.

Out of curiousity, whom do I talk to if I wish to dive
deeper into exploring Twisted and Stackless Python


Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 

Stackless mailing list
Stackless at stackless.com

More information about the Stackless mailing list