ANN: Stackless Python 0.2

Corran Webster cwebster at math.tamu.edu
Mon Jun 28 02:41:44 CEST 1999


In article <37628EAA.C682F16C at appliedbiometrics.com>,
Christian Tismer  <tismer at appliedbiometrics.com> wrote:
>ANNOUNCING:
>
>               Stackless Python 0.2
>           A Python Implementation Which
>             Does Not Ese The C Stack
>
>What is it?
>A plugin-replacement for core Python.
>It should run any program which runs under Python 1.5.2 .
>But it does not need space on the C stack.
[snip]

I managed to get this to build eventually (thanks to the hints from Michael
Hudson).  Looking at it, I wonder whether there's the potential here for
more than coroutines and to write an implementation of threading within
Python.  Each thread would presumably need its own Python stack, and a
queueing and locking system would need to be added somehow, but because
the Python and C stacks are no longer intertangled, switching between
threads should be easy (as opposed to impossible <wink>).

This wouldn't be quite as flexible as the current implimentations of
threads at the C level - C extensions would be called in a single block
with no way to swap threads until they return.  On the other hand, this
would allow every platform to have some sort of threading available,
which would be a boon.

Unfortunately I'm not familiar enough with threads to go out there and
implement it right away, but I thought I'd at least raise it as a
possibility and see what people think and what the pros and cons are.

Corran





More information about the Python-list mailing list