[Python-Dev] What is the purpose of the _PyThreadState_Current symbol in Python 3?

Gabriele phoenix1987 at gmail.com
Fri Sep 28 18:29:15 EDT 2018

On Fri, 28 Sep 2018 at 23:12, Nathaniel Smith <njs at pobox.com> wrote:
> What information do you wish the interpreter provided, that would make your program simpler and more reliable?

An exported global variable that points to the head of the
PyInterpreterState linked list (i.e. the return value of
PyInterpreterState_Head). This way my program could just look this up
from the dynsym section instead of scanning a dump of the bss section
in memory to find a possible candidate. It would be grand if also the
string in the rodata section that gives the Python version could be
dereferenced from dynsym, but that's a different question.

More information about the Python-Dev mailing list