Zope 2.7 running with Stackless 3.0
Dear friends, just by chance, I got into the position to try out Zope 2.7.0 beta 1/2, and since it needs Python 2.2.3 at least, and Stackless 3.0 was just ported to that, I tried to build Zope with Stackless 3.0. It works very very well! After a few patches to get the includes right, here the installation instructions. Get the current Stakless 3.0 beta. CVSROOT=:pserver:anonymous@centera.de:/home/cvs export CVSROOT cvs co stackless cd stackless/src ./configure make # su if your weren't root make install Then, install the Zope source, and make the same dance as usual. Just a note: Zope doesn't (yet) use any of the Stackless features. It just builds and works with it. But of course, *you* can use the stackless features, of course. I also expect, that Zope will create a branch in some future and implement a new Medusa which doesn't need real threads. cheers and let me know of your experience -- chris -- Christian Tismer :^) <mailto:tismer@tismer.com> Mission Impossible 5oftware : 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 89 09 53 34 home +49 30 802 86 56 mobile +49 173 24 18 776 PGP 0x57F3BF04 9064 F4E1 D754 C2FF 1619 305B C09C 5A3B 57F3 BF04 whom do you want to sponsor today? http://www.stackless.com/
What are the benefits of running Zope with Stackless Python? Cheers, Andreas --On Donnerstag, 28. August 2003 1:55 Uhr +0200 Christian Tismer <tismer@tismer.com> wrote:
Dear friends,
just by chance, I got into the position to try out Zope 2.7.0 beta 1/2, and since it needs Python 2.2.3 at least, and Stackless 3.0 was just ported to that, I tried to build Zope with Stackless 3.0.
It works very very well! After a few patches to get the includes right, here the installation instructions.
Get the current Stakless 3.0 beta.
CVSROOT=:pserver:anonymous@centera.de:/home/cvs export CVSROOT
cvs co stackless
cd stackless/src ./configure make # su if your weren't root make install
Then, install the Zope source, and make the same dance as usual.
Just a note: Zope doesn't (yet) use any of the Stackless features. It just builds and works with it. But of course, *you* can use the stackless features, of course.
I also expect, that Zope will create a branch in some future and implement a new Medusa which doesn't need real threads.
cheers and let me know of your experience -- chris -- Christian Tismer :^) <mailto:tismer@tismer.com> Mission Impossible 5oftware : 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 89 09 53 34 home +49 30 802 86 56 mobile +49 173 24 18 776 PGP 0x57F3BF04 9064 F4E1 D754 C2FF 1619 305B C09C 5A3B 57F3 BF04 whom do you want to sponsor today? http://www.stackless.com/
_______________________________________________ Zope-Dev maillist - Zope-Dev@zope.org http://mail.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope )
Christian Tismer wrote:
Dear friends,
just by chance, I got into the position to try out Zope 2.7.0 beta 1/2, and since it needs Python 2.2.3 at least, and Stackless 3.0 was just ported to that, I tried to build Zope with Stackless 3.0.
It works very very well! After a few patches to get the includes right, here the installation instructions.
Get the current Stakless 3.0 beta.
CVSROOT=:pserver:anonymous@centera.de:/home/cvs export CVSROOT
cvs co stackless
cd stackless/src ./configure make # su if your weren't root make install
Then, install the Zope source, and make the same dance as usual.
This is very, very cool. I've been waiting for this quite a while... Romain.
On 08/27/2003 07:55 PM, Christian Tismer wrote:
just by chance, I got into the position to try out Zope 2.7.0 beta 1/2, and since it needs Python 2.2.3 at least, and Stackless 3.0 was just ported to that, I tried to build Zope with Stackless 3.0.
It works very very well! After a few patches to get the includes right, here the installation instructions.
I am in awe. Cool. :-) However, I am also a little confused. As I understand it, Stackless needs all C code to be non-reentrant, i.e. C code must never call back into Python. But Zope has a lot of reentrant code, especially in Acquisition and ZODB. Doesn't that prevent Zope from taking advantage of Stackless continuations? Shane
Shane Hathaway wrote:
On 08/27/2003 07:55 PM, Christian Tismer wrote:
just by chance, I got into the position to try out Zope 2.7.0 beta 1/2, and since it needs Python 2.2.3 at least, and Stackless 3.0 was just ported to that, I tried to build Zope with Stackless 3.0.
It works very very well! After a few patches to get the includes right, here the installation instructions.
I am in awe. Cool. :-)
However, I am also a little confused. As I understand it, Stackless needs all C code to be non-reentrant, i.e. C code must never call back into Python.
This has never been so. It was so that Stackless 1.0 could only do its switching if there was no recursive call, sure. But it was always allowed. Stackless 2.0 does it the brute-force way, by moving C stacks around. Stackless 3.0 does all of it, whatever is possible. That means, you can switch whatever, even extension C code with Python callbacks. But cooperative code can switch faster.
But Zope has a lot of reentrant code, especially in Acquisition and ZODB. Doesn't that prevent Zope from taking advantage of Stackless continuations?
No continuations, tasklets. :-) ciao - chris -- Christian Tismer :^) <mailto:tismer@tismer.com> Mission Impossible 5oftware : 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 89 09 53 34 home +49 30 802 86 56 pager +49 173 24 18 776 PGP 0x57F3BF04 9064 F4E1 D754 C2FF 1619 305B C09C 5A3B 57F3 BF04 whom do you want to sponsor today? http://www.stackless.com/
Christian Tismer wrote:
Stackless 3.0 does all of it, whatever is possible. That means, you can switch whatever, even extension C code with Python callbacks. But cooperative code can switch faster.
I'm very happy to hear you've forged onward. I was concerned you had given up.
But Zope has a lot of reentrant code, especially in Acquisition and ZODB. Doesn't that prevent Zope from taking advantage of Stackless continuations?
No continuations, tasklets. :-)
Did you switch the terminology? Where can I read about Stackless 3.0? For the uninitiated: Stackless lets a Python program break out of the rigid constraints of a simple stack. It lets Python code manipulate its own execution. It provides new solutions to problems like threading, debugging, network communication, etc. It's a very interesting shift. BTW, here's one avenue you might pursue, Christian: Python IDEs. When I wrote the debugger for Boa Constructor, I hit a big wall. Since Python is a dynamic language, one would expect to be able to pause the execution of a function, change the function, and resume execution with new code--never skipping a beat. But CPython makes this nearly impossible. I imagine Stackless would provide an answer for this. If it does, get in contact with ActiveState, Secret Labs, or the Wing IDE folks and tell them you can make their debugger twice as good as any other. Just an idea. Shane
Shane Hathaway wrote:
Christian Tismer wrote:
Stackless 3.0 does all of it, whatever is possible. That means, you can switch whatever, even extension C code with Python callbacks. But cooperative code can switch faster.
I'm very happy to hear you've forged onward. I was concerned you had given up.
I never give up. Giving up is for me the equivalent to death. I'm undead. ;-) ...
No continuations, tasklets. :-)
Did you switch the terminology? Where can I read about Stackless 3.0?
You will be able to, soon. At the moment, just read help("stackless"). Stackless 3.0 no longer has the primitive, most powerful concept of continuations, it just has tasklets. Tasklets are like one-shot continuations, so they are no longer immutable. In other words, they are like tiny threads. The reasons for that are multiple. But the main reason is the hardware switching capability. It is a feature of SLP 3.0. SLP 2.0 did only this. SLP 3.0 does this, and a subset of the 1.0 continuations, but reduced to a common subset. With the presence of hardware C stack snapshot, it is not trivially possible to provide immutable, re-runnable instances of such C stacks. I only can (almost) guarantee, that they can continue once, after they have been freezed. This is so, since I was (so far) unable to provide a platform/compiler independent way to completely analyse them for the presence of Python objects. In summary, that means, allowing for C stack captures in a compatible way kills the concept of pure continuations. On the other hand, killing the concept of pure continuations allows me to make C stack snapshots and pure Python frame chains to be rather compatible. So what I do is to wrap an abject around both, called a tasklet. And such a tasklet can be run just once, since it has mutable state. But this is exactly what peaople want.
For the uninitiated: Stackless lets a Python program break out of the rigid constraints of a simple stack. It lets Python code manipulate its own execution. It provides new solutions to problems like threading, debugging, network communication, etc. It's a very interesting shift.
This is still true!
BTW, here's one avenue you might pursue, Christian: Python IDEs. When I wrote the debugger for Boa Constructor, I hit a big wall.
*You* wrote the Boa debugger? Well, this is great. We need to talk.
Since Python is a dynamic language, one would expect to be able to pause the execution of a function, change the function, and resume execution with new code--never skipping a beat. But CPython makes this nearly impossible. I imagine Stackless would provide an answer for this. If it does, get in contact with ActiveState, Secret Labs, or the Wing IDE folks and tell them you can make their debugger twice as good as any other. Just an idea.
A very good idea. Although all of these people know me well, and I think I don't need to talk so much. Instead, they are kind of waiting. Actually, they don't need to wait so long, since SLP 3.0 final is coming in the next three weeks, with a decent C API. cheers & thanks -- chris -- Christian Tismer :^) <mailto:tismer@tismer.com> Mission Impossible 5oftware : 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 89 09 53 34 home +49 30 802 86 56 mobile +49 173 24 18 776 PGP 0x57F3BF04 9064 F4E1 D754 C2FF 1619 305B C09C 5A3B 57F3 BF04 whom do you want to sponsor today? http://www.stackless.com/
participants (4)
-
Andreas Jung -
Christian Tismer -
Romain Slootmaekers -
Shane Hathaway