[Stackless] Threads and Tasklets

Christian Tismer tismer at stackless.com
Fri Oct 28 10:43:16 CEST 2005

Andrew Francis wrote:

> Hello Bob:
> --- Bob Ippolito <bob at redivi.com> wrote:
>>To write a high performance socket application, you
>>NEED to use  select or equivalent.  It doesn't
> matter
>>whether you're using  stackless or not,
>>os-thread-per-connection does not scale.
> Yes I know high-performance socket applications
> use select() and use design patterns like Doug
> Schmitt's Reactor.  
> Right now high performance isn't my major concern.
> Clarity of code and correctness are far more
> important.

That's the gap Stackless tries to close:
You can write asynchronous code in a readable,
simple way.

> I have to look at asyncore and Twisted to see how
> easy they are to use. 

I will give a small example how this can be done,
by providing a stackless socket module.

Twisted's interface is as good as it can be if
callbacks are needed.
Asyncore is as good as it can be if you cannot directly
switch context.

With Stackless, this code gets half in size, and you can use
your connections as if they had their own thread.
No callbacks needed.

ciao - chris

Christian Tismer             :^)   <mailto:tismer at stackless.com>
tismerysoft GmbH             :     Have a break! Take a ride on Python's
Johannes-Niemeyer-Weg 9A     :    *Starship* http://starship.python.net/
14109 Berlin                 :     PGP key -> http://wwwkeys.pgp.net/
work +49 30 802 86 56  mobile +49 173 24 18 776  fax +49 30 80 90 57 05
PGP 0x57F3BF04       9064 F4E1 D754 C2FF 1619  305B C09C 5A3B 57F3 BF04
      whom do you want to sponsor today?   http://www.stackless.com/

Stackless mailing list
Stackless at stackless.com

More information about the Stackless mailing list