[Stackless] Re: Stackless bug/typo

Christian Tismer tismer at tismer.com
Wed Jun 19 18:52:06 CEST 2002


Jeff Senn wrote:
...

> I even crash occasionally (usually in "Tk-callback-land" somewhere)
> when slicing is enabled.  So I suspect there is still some _tkinter
> problem lurking somewhere...

Well, I've asked quite a lot of people.
For one, there is the slicing prob.
Is it possible for you to build Tcl in a way
that you can get a stack dump when it crashes?
I admit, this is quite some work.

The other thing that gives me headaches is this:
There is usually one Tcl interpreter created for
every real thread.
Tcl keeps so-called callframes on the C stack.
Without changing Tcl to use the heap, we therefore
cannot use stack slicing at all, since Tcl uses
these chained callframes for variable lookup.

Furthermore, we probably can't allow automatic scheduling
at the moment, when Tcl is involved, unless I build
a lot more support for it: The thread-global Tcl
interpreter has pointers to the most recent callframes.
It thinks, there is only one such chain. But when you are
using tasklets, there are more chains. Tcl treats it
as one, and messes up, of course.

The brutal solution is to disallow auto-scheduling,
until all nested callframes of a tasklet have disappeared.
By that, there always exists at most one single
callframe chain.
Can you please check out if that makes sense at all?
Is the thing scheduling then, or does it block, completely?

The other approach would be tokeep track of these
pointer variables. They must be saved and stored
at every tasklet switch. This would hopefully maintain
a correct callframe "tree".
Maybe there is a simpler hack, by supplying an extra
sub-interpreter for every tasklet that needs it, and
just taking care of this one.

I don't know, please let me know if you find something
out. I'd like to get maximum effect with minimum effort,
we just need to find out.

cheers - chris

-- 
Christian Tismer             :^)   <mailto:tismer at 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/


_______________________________________________
Stackless mailing list
Stackless at www.tismer.com
http://www.tismer.com/mailman/listinfo/stackless



More information about the Stackless mailing list