[Stackless] Design Q. about frames

Christian Tismer tismer at stackless.com
Thu Mar 18 02:05:03 CET 2004

Hi friends,

I've been hacking quite a bit after the sprint.
The state of the source trunk is now almost in a state
that this could be the current delivered state.
I still didn't change the sprint folder to src,
since I'm thinking to do one last change:

There is the almost solved issue of f_callee.
It *might* be possible to remove it now.

The other issue is pickling of running generators.
I tried several things, but it turns out that we
absolutely need a callback after a generator is run.

This can take one of two faces:
a) Crate a baseframe object that has the action to be performed.
b) Add an f_on_return field to frames which is called on return.

Both a) and b) can do the task.
Having an extra frame lingering around for every generator
call might be doable with some caching.
But having the return callback could have some advantages,
given that the overhead of an extra call is not too high:

- probably, this callback could do the frame deallocation
   by default and therefore remove f_callee.
- this is a cheap callback added to all regular frames, and
   it can serve more purposes than just generator support,
   for instance it could be a simple callback that makes
   __init__ and ohter special methods stackless.

All this can be accomplished with an extra frame, of course.
But it might make sense to add this simple callback feature,
since it would be cheaper.

But I'm undecided.
Please, give me your input ASAP.

On registration for pickling: Both approaches would need to be
registered, somehow. b) would involve an extra registry for
pickling these callbacks, a) would be simpler since it would
go into the f_execute registry.
But I don't care, you decide.

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

Stackless mailing list
Stackless at stackless.com

More information about the Stackless mailing list