mirror of https://github.com/python/cpython
8ba4df91ae
This fixes a crasher due to a race condition, triggered infrequently when two isolated (own GIL) subinterpreters simultaneously initialize their sys or builtins modules. The crash happened due the combination of the "detached" thread state we were using and the "last holder" logic we use for the GIL. It turns out it's tricky to use the same thread state for different threads. Who could have guessed? We solve the problem by eliminating the one object we were still sharing between interpreters. We replace it with a low-level hashtable, using the "raw" allocator to avoid tying it to the main interpreter. We also remove the accommodations for "detached" thread states, which were a dubious idea to start with. |
||
---|---|---|
.. | ||
cpython | ||
internal | ||
Python.h | ||
README.rst | ||
abstract.h | ||
bltinmodule.h | ||
boolobject.h | ||
bytearrayobject.h | ||
bytesobject.h | ||
ceval.h | ||
codecs.h | ||
compile.h | ||
complexobject.h | ||
datetime.h | ||
descrobject.h | ||
dictobject.h | ||
dynamic_annotations.h | ||
enumobject.h | ||
errcode.h | ||
exports.h | ||
fileobject.h | ||
fileutils.h | ||
floatobject.h | ||
frameobject.h | ||
genericaliasobject.h | ||
import.h | ||
interpreteridobject.h | ||
intrcheck.h | ||
iterobject.h | ||
listobject.h | ||
longobject.h | ||
marshal.h | ||
memoryobject.h | ||
methodobject.h | ||
modsupport.h | ||
moduleobject.h | ||
object.h | ||
objimpl.h | ||
opcode.h | ||
osdefs.h | ||
osmodule.h | ||
patchlevel.h | ||
py_curses.h | ||
pybuffer.h | ||
pycapsule.h | ||
pydtrace.d | ||
pydtrace.h | ||
pyerrors.h | ||
pyexpat.h | ||
pyframe.h | ||
pyhash.h | ||
pylifecycle.h | ||
pymacconfig.h | ||
pymacro.h | ||
pymath.h | ||
pymem.h | ||
pyport.h | ||
pystate.h | ||
pystats.h | ||
pystrcmp.h | ||
pystrtod.h | ||
pythonrun.h | ||
pythread.h | ||
pytypedefs.h | ||
rangeobject.h | ||
setobject.h | ||
sliceobject.h | ||
structmember.h | ||
structseq.h | ||
sysmodule.h | ||
traceback.h | ||
tupleobject.h | ||
typeslots.h | ||
unicodeobject.h | ||
warnings.h | ||
weakrefobject.h |
README.rst
The Python C API ================ The C API is divided into these sections: 1. ``Include/``: Limited API 2. ``Include/cpython/``: CPython implementation details 3. ``Include/cpython/``, names with the ``PyUnstable_`` prefix: API that can change between minor releases 4. ``Include/internal/``, and any name with ``_`` prefix: The internal API Information on changing the C API is available `in the developer guide`_ .. _in the developer guide: https://devguide.python.org/c-api/