[Python-Dev] Re: Stackless Python

Phillip J. Eby pje at telecommunity.com
Thu Jun 3 11:22:01 EDT 2004


At 01:23 PM 6/3/04 +0100, Paul Moore wrote:
>Christian Tismer <tismer at stackless.com> writes:
>
> > This is true, we have written demo implementations of tasklets
> > with pure Python and threads on the last sprint.
> >
> > The difference is that nobody would use these for production code,
>
>I don't know if this is true. In a production environment where there
>is an existing Python installation, but no Stackless installation, and
>where performance is not a killer issue, tasklets *may* be useful for
>their organisational benefits.
>
>I say *may* because I don't know much about tasklets. A pure Python
>implementation may help my understanding.
>
>Is the demo downloadable from anywhere?

Also keep in mind that tasklet-like operations can be done using 
state-machine callbacks (e.g. Twisted), or using nested generators (e.g. 
'peak.events').  Callbacks have the problem of "twisting" what would 
otherwise be linear code, and if you're using generators, you have to use 
"generators all the way down" to code that does task switching.  IOW, you 
can't have a non-generator call a generator and have that generator be able 
to task-switch.

The net result of either approach is that you can't use any existing code 
(outside of those frameworks, of course) as part of your tasks.




More information about the Python-Dev mailing list