[Python-Dev] _tkinter problem with Stackless

Jack Jansen Jack.Jansen@cwi.nl
Tue, 28 May 2002 12:09:23 +0200


On Monday, May 27, 2002, at 05:23 , Christian Tismer wrote:
> Meanwhile, I've implemented a really cheap solution.
> By a small 3-line patch, _tkinter is able to tell
> Stackless that it should better not split stacks
> for the next N recursions. Works great!

For that one case (tkinter), but not in general. Would it be possible to 
somehow restructure this the other way around, i.e. not slice stacks 
unless you know that all frames on the stack so far don't mind? I'm 
thinking of something similar to BEGIN_ALLOW_THREADS: any naive 
extension module whose author didn't know about Python threading will 
still work fine in a threaded Python, because it'll just hold on to the 
interpreter lock.

If this is impossible (which I can well imagine) then at the very least 
we should have a macro KEEP_YOUR_DIRTY_FINGERS_OFF_MY_STACK() to tell 
stackless that you've given away stack addresses to some external 
package and you don't want your stack to be moved.
--
- Jack Jansen        <Jack.Jansen@oratrix.com>        
http://www.cwi.nl/~jack -
- If I can't dance I don't want to be part of your revolution -- Emma 
Goldman -