[issue38160] Add a "PyInterpreterState *" field to PyTypeObject.

STINNER Victor report at bugs.python.org
Fri Sep 27 05:39:27 EDT 2019


STINNER Victor <vstinner at python.org> added the comment:

> No, but it means that a type A *knows* that it was created in interpreter 1 without relying on the current thread local storage.

What's wrong with _PyInterpreterState_GET_UNSAFE()?

This macro is based on _Py_atomic_load_relaxed(&_PyRuntime.gilstate.tstate_current).

If this atomic variable is an issue, do we need a better solution to get the current thread state and get the current interpreter?

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue38160>
_______________________________________


More information about the Python-bugs-list mailing list