[Stackless] Threads and Tasklets

Bob Ippolito bob at redivi.com
Mon Oct 24 18:28:24 CEST 2005

On Oct 24, 2005, at 9:00 AM, Andrew Francis wrote:

> Hi Richard:
> This is how I understand it...
>> While I may be wrong, I doubt you can have a separate
>> instance of the stackless module running in each
>> thread as I believe it implements a singleton of the
>> scheduler. You would have to have either one thread
>> that does stackless things and the rest as worker
>> type threads or a separate interpreter for each
>> stackless instance I expect.
> I am interested in scenario one:
> 1) Thread One running stackless
> 2) Thread Two running I/O stuff
> The two threads communicate asynchronous - i.e., a
> queue. The stackless thread is reactive - it runs
> when there is input.

If you're using non-blocking sockets you don't need any real  
threads.  Twisted is single threaded, and doesn't require any  
additional threads for I/O.. it doesn't even use stackless.  asyncore  
is another example of this.

You might even be able to find the old eGroups python-coro code and  
refactor it to use modern stackless.


Stackless mailing list
Stackless at stackless.com

More information about the Stackless mailing list