Stackless Python, eventual merge?

Christian Tismer tismer at
Wed Sep 18 09:33:32 EDT 2002

Oren Tirosh wrote:

> They may be dangerous in some circumstances. IIRC, if a C extension calls
> the Python interpreter recursively with pointers to things on its stack
> it can cause memory corruption. 

Then don't switch stacks in that context.
The switching occours on your demand.
And if this extension is essential and
must be protected from any overseen switching,
let me add protection code to it. This is easy.

But the theoretical possibility to create a crash
is no reason to dispense with the benefits.

My only chance to do this magic with almost no crash
possibility would be to allocate a new stack for
every new tasklet. I have considered this many times.
A benefit would be reasonably faster switching, while
the drawback would be the reasonable high memory
requirement for a full machine stack.
I might consider a hybrid solution, putting certain
"dangerous" extension stuff into a real new stack
all the time, together with the quite fast and very
cheap other safe tasklets.

Just-need-an-idea-how-to-determine-that - ly y'rs - chris
Christian Tismer             :^)   <mailto:tismer at>
Mission Impossible 5oftware  :     Have a break! Take a ride on Python's
Johannes-Niemeyer-Weg 9a     :    *Starship*
14109 Berlin                 :     PGP key ->
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?

More information about the Python-list mailing list