Meaning of the f_tstate field in the frame object

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

Meaning of the f_tstate field in the frame object

Mark Shannon-3
What is the purpose of the f_tstate field in the frame object?
It holds a borrowed reference to the threadstate in which the frame
was created.

If PyThreadState_GET()->frame->f_state == PyThreadState_GET()
then it is redundant.

But what if PyThreadState_GET()->frame->f_state != PyThreadState_GET(),
which can happen when a generator is created in one thread and called in
another?

Removing the f_tstate field provides a clean fix to
http://bugs.python.org/issue14432, but is it safe to do so?
I think it is safe, but does anyone think otherwise?

(Removing it requires the replacement of frame->f_state
with PyThreadState_GET() at one place in _PyEval_CallTracing)

Cheers,
Mark.
_______________________________________________
Python-Dev mailing list
[hidden email]
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: http://mail.python.org/mailman/options/python-dev/lists%2B1324100855712-1801473%40n6.nabble.com