[Python-Dev] Proposal to drop f_tstate

Christian Tismer tismer@tismer.com
Thu, 12 Jun 2003 04:25:47 +0200


Dear developers,

For years, there has been a f_tstate field in frames.

During my implementation of thread pickling for Stackless,
I investigated how much use is made of this field.
I found out that it is only used in rare cases, only, and can
be most probably replaced by PyThreadState_GET() in the
six or seven cases where it is touched at all.

f_tstate would make sense if PyThreadState_GET() wasn't
such a cheap macro. It also would make sense if it were used
somewhere to assure proper allocation of a frame to its tstate.
But this is nowhere used.
In the case of Stackless, f_tstate turns out to be even a
drawback, since non-recursively called frames can be freely
moved between real threads, and I'm saving updates to f_tstate
already, simply by removing it.

I also didn't find any external module that uses f_tstate.

Therefore, I hereby propose to remove this frame field,
in order to save space.

I also offer to provide the simple patch, right now.

cheers -- chris

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