[Stackless] Stackless on PyPy 2.0 with JIT

Christian Tismer tismer at stackless.com
Sat Apr 27 18:01:15 CEST 2013

On 16.04.13 23:35, Carlos Eduardo de Paula wrote:
> Hello everyone,
> I've been following the PyPy progress for some time and recently saw 
> that PyPy 2.0 (currently in beta2) already supports Stackless features 
> integrated with the JIT so it can have good performance using both 
> features.
> I tested a couple scripts I had and most of them works. The ones that 
> does not work are related to recursion but my tests are far from 
> comprehensive.
> I see this as good news since PyPy progress has been great in the last 
> years.
> http://doc.pypy.org/en/latest/release-2.0.0-beta2.html

Hi Carlos,

no wonder that you get problems with recursion.
PyPy's support for Stackless is usable for concurrency, but
different, since PyPy never adopted the way Stackless avoids the
Stack and with no "soft-switching".

It is more like greenlets that led to the tealet which is meanwhile
a stacklet (based upon the continulet...), but effectively the stack
is still in use.

The difference is a bit hard to explain:

In Stackless, the pickleable program state needs collaborative multitasking,
and this happens in all cases where no stack is in the way.
When "hard-switching" is done, the piece of stack to move around is an 
structure that we cannot inspect and pickle, yet.

In PyPy, no "soft-switching" ever occurs, it all looks more like 
i.E. the interpreter is forced into another context by stack copying.
But in contrast to Stackless, because all existing structures come from
PyPy, even those structures can be introspected and (theoretycally)
pickled. I'm not sure if that is implemented, yet.

You can read more about Stackless features in PyPy here:

cheers - chris

Christian Tismer             :^)   <mailto:tismer at stackless.com>
Software Consulting          :     Have a break! Take a ride on Python's
Karl-Liebknecht-Str. 121     :    *Starship* http://starship.python.net/
14482 Potsdam                :     PGP key -> http://pgp.uni-mainz.de
phone +49 173 24 18 776  fax +49 (30) 700143-0023
PGP 0x57F3BF04       9064 F4E1 D754 C2FF 1619  305B C09C 5A3B 57F3 BF04
       whom do you want to sponsor today?   http://www.stackless.com/

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.stackless.com/pipermail/stackless/attachments/20130427/05393f0e/attachment.html>

More information about the Stackless mailing list