René's URL Explorer Experiment


Title: Thread states and the global interpreter lock — Python 3.16.0a2 documentation

Open Graph Title: Thread states and the global interpreter lock

Description: Unless on a free-threaded build of CPython, the Python interpreter is generally not thread-safe. In order to support multi-threaded Python programs, there’s a global lock, called the global interpr...

Open Graph Description: Unless on a free-threaded build of CPython, the Python interpreter is generally not thread-safe. In order to support multi-threaded Python programs, there’s a global lock, called the global interpr...

Opengraph URL: https://docs.python.org/3/c-api/threads.html

direct link

Domain: docs.python.org

og:typewebsite
og:site_namePython documentation
og:image:width1146
og:image:height600
og:imagehttps://docs.python.org/3.16/_images/social_previews/summary_c-api_threads_49a64cf1.png
og:image:altUnless on a free-threaded build of CPython, the Python interpreter is generally not thread-safe. In order to support multi-threaded Python programs, there’s a global lock, called the global interpr...
twitter:cardsummary_large_image
theme-color#3776ab
readthedocs-addons-api-version1

Links:

https://www.python.org/
Table of Contentshttps://docs.python.org/dev/contents.html
Thread states and the global interpreter lockhttps://docs.python.org/dev/c-api/threads.html
Detaching the thread state from extension codehttps://docs.python.org/dev/c-api/threads.html#detaching-the-thread-state-from-extension-code
APIshttps://docs.python.org/dev/c-api/threads.html#apis
Using the C API from foreign threadshttps://docs.python.org/dev/c-api/threads.html#using-the-c-api-from-foreign-threads
Reusing a thread state across repeated callshttps://docs.python.org/dev/c-api/threads.html#reusing-a-thread-state-across-repeated-calls
Attaching/detaching thread stateshttps://docs.python.org/dev/c-api/threads.html#attaching-detaching-thread-states
GIL-state APIshttps://docs.python.org/dev/c-api/threads.html#gil-state-apis
Cautions about fork()https://docs.python.org/dev/c-api/threads.html#cautions-about-fork
High-level APIshttps://docs.python.org/dev/c-api/threads.html#high-level-apis
Low-level APIshttps://docs.python.org/dev/c-api/threads.html#low-level-apis
Asynchronous notificationshttps://docs.python.org/dev/c-api/threads.html#asynchronous-notifications
Operating system thread APIshttps://docs.python.org/dev/c-api/threads.html#operating-system-thread-apis
Interpreter initialization and finalizationhttps://docs.python.org/dev/c-api/interp-lifecycle.html
Synchronization primitiveshttps://docs.python.org/dev/c-api/synchronization.html
Report a bughttps://docs.python.org/dev/bugs.html
Improve this pagehttps://docs.python.org/dev/improve-page-nojs.html
Show source https://github.com/python/cpython/blob/main/Doc/c-api/threads.rst?plain=1
indexhttps://docs.python.org/dev/genindex.html
moduleshttps://docs.python.org/dev/py-modindex.html
nexthttps://docs.python.org/dev/c-api/synchronization.html
previoushttps://docs.python.org/dev/c-api/interp-lifecycle.html
Pythonhttps://www.python.org/
3.16.0a2 documentationhttps://docs.python.org/dev/index.html
Python/C API reference manualhttps://docs.python.org/dev/c-api/index.html
Thread states and the global interpreter lockhttps://docs.python.org/dev/c-api/threads.html
https://docs.python.org/dev/c-api/threads.html#thread-states-and-the-global-interpreter-lock
free-threaded buildhttps://docs.python.org/dev/glossary.html#term-free-threaded-build
CPythonhttps://docs.python.org/dev/glossary.html#term-CPython
global interpreter lockhttps://docs.python.org/dev/glossary.html#term-global-interpreter-lock
GILhttps://docs.python.org/dev/glossary.html#term-GIL
sys.setswitchinterval()https://docs.python.org/dev/library/sys.html#sys.setswitchinterval
detaching the thread statehttps://docs.python.org/dev/c-api/threads.html#detaching-thread-state
PyThreadStatehttps://docs.python.org/dev/c-api/threads.html#c.PyThreadState
thread statehttps://docs.python.org/dev/glossary.html#term-thread-state
attachedhttps://docs.python.org/dev/glossary.html#term-attached-thread-state
attached thread statehttps://docs.python.org/dev/glossary.html#term-attached-thread-state
Py_BEGIN_ALLOW_THREADShttps://docs.python.org/dev/c-api/threads.html#c.Py_BEGIN_ALLOW_THREADS
PyThreadState_GetUnchecked()https://docs.python.org/dev/c-api/threads.html#c.PyThreadState_GetUnchecked
PyThreadState_Ensure()https://docs.python.org/dev/c-api/threads.html#c.PyThreadState_Ensure
PyThreadState_EnsureFromView()https://docs.python.org/dev/c-api/threads.html#c.PyThreadState_EnsureFromView
https://docs.python.org/dev/c-api/threads.html#detaching-the-thread-state-from-extension-code
thread statehttps://docs.python.org/dev/glossary.html#term-thread-state
Py_BEGIN_ALLOW_THREADShttps://docs.python.org/dev/c-api/threads.html#c.Py_BEGIN_ALLOW_THREADS
Py_END_ALLOW_THREADShttps://docs.python.org/dev/c-api/threads.html#c.Py_END_ALLOW_THREADS
PyEval_SaveThread()https://docs.python.org/dev/c-api/threads.html#c.PyEval_SaveThread
PyEval_RestoreThread()https://docs.python.org/dev/c-api/threads.html#c.PyEval_RestoreThread
zlibhttps://docs.python.org/dev/library/zlib.html#module-zlib
hashlibhttps://docs.python.org/dev/library/hashlib.html#module-hashlib
thread statehttps://docs.python.org/dev/glossary.html#term-attached-thread-state
free-threaded buildhttps://docs.python.org/dev/glossary.html#term-free-threaded-build
GILhttps://docs.python.org/dev/glossary.html#term-GIL
Cautions regarding interpreter finalizationhttps://docs.python.org/dev/c-api/interp-lifecycle.html#cautions-regarding-runtime-finalization
https://docs.python.org/dev/c-api/threads.html#apis
free-threaded buildhttps://docs.python.org/dev/glossary.html#term-free-threaded-build
https://docs.python.org/dev/c-api/threads.html#c.Py_BEGIN_ALLOW_THREADS
Stable ABIhttps://docs.python.org/dev/c-api/stable.html#stable
Py_END_ALLOW_THREADShttps://docs.python.org/dev/c-api/threads.html#c.Py_END_ALLOW_THREADS
https://docs.python.org/dev/c-api/threads.html#c.Py_END_ALLOW_THREADS
Stable ABIhttps://docs.python.org/dev/c-api/stable.html#stable
Py_BEGIN_ALLOW_THREADShttps://docs.python.org/dev/c-api/threads.html#c.Py_BEGIN_ALLOW_THREADS
https://docs.python.org/dev/c-api/threads.html#c.Py_BLOCK_THREADS
Stable ABIhttps://docs.python.org/dev/c-api/stable.html#stable
Py_END_ALLOW_THREADShttps://docs.python.org/dev/c-api/threads.html#c.Py_END_ALLOW_THREADS
https://docs.python.org/dev/c-api/threads.html#c.Py_UNBLOCK_THREADS
Stable ABIhttps://docs.python.org/dev/c-api/stable.html#stable
Py_BEGIN_ALLOW_THREADShttps://docs.python.org/dev/c-api/threads.html#c.Py_BEGIN_ALLOW_THREADS
https://docs.python.org/dev/c-api/threads.html#using-the-c-api-from-foreign-threads
threadinghttps://docs.python.org/dev/library/threading.html#module-threading
PyThreadState_Ensure()https://docs.python.org/dev/c-api/threads.html#c.PyThreadState_Ensure
PyThreadState_EnsureFromView()https://docs.python.org/dev/c-api/threads.html#c.PyThreadState_EnsureFromView
PyInterpreterGuard_FromCurrent()https://docs.python.org/dev/c-api/interp-lifecycle.html#c.PyInterpreterGuard_FromCurrent
PyInterpreterView_FromCurrent()https://docs.python.org/dev/c-api/interp-lifecycle.html#c.PyInterpreterView_FromCurrent
PyInterpreterView_FromMain()https://docs.python.org/dev/c-api/interp-lifecycle.html#c.PyInterpreterView_FromMain
PEP 788https://peps.python.org/pep-0788/
https://docs.python.org/dev/c-api/threads.html#reusing-a-thread-state-across-repeated-calls
PyThreadStatehttps://docs.python.org/dev/c-api/threads.html#c.PyThreadState
free-threaded buildhttps://docs.python.org/dev/glossary.html#term-free-threaded-build
PyThreadState_New()https://docs.python.org/dev/c-api/threads.html#c.PyThreadState_New
PyEval_RestoreThread()https://docs.python.org/dev/c-api/threads.html#c.PyEval_RestoreThread
PyEval_SaveThread()https://docs.python.org/dev/c-api/threads.html#c.PyEval_SaveThread
PyInterpreterState_Get()https://docs.python.org/dev/c-api/subinterpreters.html#c.PyInterpreterState_Get
PyThreadState_Ensure()https://docs.python.org/dev/c-api/threads.html#c.PyThreadState_Ensure
PyGILState_Ensure()https://docs.python.org/dev/c-api/threads.html#c.PyGILState_Ensure
PyThreadState_New()https://docs.python.org/dev/c-api/threads.html#c.PyThreadState_New
Py_FinalizeEx()https://docs.python.org/dev/c-api/interp-lifecycle.html#c.Py_FinalizeEx
PyEval_RestoreThread()https://docs.python.org/dev/c-api/threads.html#c.PyEval_RestoreThread
Cautions regarding interpreter finalizationhttps://docs.python.org/dev/c-api/interp-lifecycle.html#cautions-regarding-runtime-finalization
https://docs.python.org/dev/c-api/threads.html#attaching-detaching-thread-states
PyThreadStateTokenhttps://docs.python.org/dev/c-api/threads.html#c.PyThreadStateToken
PyInterpreterGuardhttps://docs.python.org/dev/c-api/interp-lifecycle.html#c.PyInterpreterGuard
https://docs.python.org/dev/c-api/threads.html#c.PyThreadState_Ensure
Stable ABIhttps://docs.python.org/dev/c-api/stable.html#stable
PyThreadState_Release()https://docs.python.org/dev/c-api/threads.html#c.PyThreadState_Release
PyThreadState_Release()https://docs.python.org/dev/c-api/threads.html#c.PyThreadState_Release
thread statehttps://docs.python.org/dev/glossary.html#term-thread-state
PyThreadState_New()https://docs.python.org/dev/c-api/threads.html#c.PyThreadState_New
PyGILState_GetThisThreadState()https://docs.python.org/dev/c-api/threads.html#c.PyGILState_GetThisThreadState
PyThreadStateTokenhttps://docs.python.org/dev/c-api/threads.html#c.PyThreadStateToken
PyInterpreterViewhttps://docs.python.org/dev/c-api/interp-lifecycle.html#c.PyInterpreterView
https://docs.python.org/dev/c-api/threads.html#c.PyThreadState_EnsureFromView
Stable ABIhttps://docs.python.org/dev/c-api/stable.html#stable
PyThreadState_Ensure()https://docs.python.org/dev/c-api/threads.html#c.PyThreadState_Ensure
PyThreadState_Release()https://docs.python.org/dev/c-api/threads.html#c.PyThreadState_Release
PyThreadStateTokenhttps://docs.python.org/dev/c-api/threads.html#c.PyThreadStateToken
https://docs.python.org/dev/c-api/threads.html#c.PyThreadState_Release
Stable ABIhttps://docs.python.org/dev/c-api/stable.html#stable
PyThreadState_Ensure()https://docs.python.org/dev/c-api/threads.html#c.PyThreadState_Ensure
PyThreadState_EnsureFromView()https://docs.python.org/dev/c-api/threads.html#c.PyThreadState_EnsureFromView
PyThreadState_Release()https://docs.python.org/dev/c-api/threads.html#c.PyThreadState_Release
Py_FatalError()https://docs.python.org/dev/c-api/sys.html#c.Py_FatalError
https://docs.python.org/dev/c-api/threads.html#c.PyThreadStateToken
Stable ABIhttps://docs.python.org/dev/c-api/stable.html#stable
PyThreadState_Ensure()https://docs.python.org/dev/c-api/threads.html#c.PyThreadState_Ensure
PyThreadState_Release()https://docs.python.org/dev/c-api/threads.html#c.PyThreadState_Release
https://docs.python.org/dev/c-api/threads.html#gil-state-apis
Cautions regarding interpreter finalizationhttps://docs.python.org/dev/c-api/interp-lifecycle.html#cautions-regarding-runtime-finalization
soft deprecatedhttps://docs.python.org/dev/glossary.html#term-soft-deprecated
new APIshttps://docs.python.org/dev/c-api/threads.html#c-api-foreign-threads
https://docs.python.org/dev/c-api/threads.html#c.PyGILState_STATE
Stable ABIhttps://docs.python.org/dev/c-api/stable.html#stable
PyGILState_Ensure()https://docs.python.org/dev/c-api/threads.html#c.PyGILState_Ensure
PyGILState_Release()https://docs.python.org/dev/c-api/threads.html#c.PyGILState_Release
https://docs.python.org/dev/c-api/threads.html#c.PyGILState_STATE.PyGILState_LOCKED
PyGILState_Ensure()https://docs.python.org/dev/c-api/threads.html#c.PyGILState_Ensure
https://docs.python.org/dev/c-api/threads.html#c.PyGILState_STATE.PyGILState_UNLOCKED
PyGILState_Ensure()https://docs.python.org/dev/c-api/threads.html#c.PyGILState_Ensure
PyGILState_STATEhttps://docs.python.org/dev/c-api/threads.html#c.PyGILState_STATE
https://docs.python.org/dev/c-api/threads.html#c.PyGILState_Ensure
Stable ABIhttps://docs.python.org/dev/c-api/stable.html#stable
attached thread statehttps://docs.python.org/dev/glossary.html#term-attached-thread-state
PyGILState_Release()https://docs.python.org/dev/c-api/threads.html#c.PyGILState_Release
PyGILState_Ensure()https://docs.python.org/dev/c-api/threads.html#c.PyGILState_Ensure
Py_BEGIN_ALLOW_THREADShttps://docs.python.org/dev/c-api/threads.html#c.Py_BEGIN_ALLOW_THREADS
Py_END_ALLOW_THREADShttps://docs.python.org/dev/c-api/threads.html#c.Py_END_ALLOW_THREADS
attached thread statehttps://docs.python.org/dev/glossary.html#term-attached-thread-state
PyGILState_Ensure()https://docs.python.org/dev/c-api/threads.html#c.PyGILState_Ensure
PyGILState_Release()https://docs.python.org/dev/c-api/threads.html#c.PyGILState_Release
attached thread statehttps://docs.python.org/dev/glossary.html#term-attached-thread-state
Py_FatalError()https://docs.python.org/dev/c-api/sys.html#c.Py_FatalError
Cautions regarding interpreter finalizationhttps://docs.python.org/dev/c-api/interp-lifecycle.html#cautions-regarding-runtime-finalization
Soft deprecatedhttps://docs.python.org/dev/glossary.html#term-soft-deprecated
PyThreadState_Ensure()https://docs.python.org/dev/c-api/threads.html#c.PyThreadState_Ensure
PyThreadState_EnsureFromView()https://docs.python.org/dev/c-api/threads.html#c.PyThreadState_EnsureFromView
PyGILState_STATEhttps://docs.python.org/dev/c-api/threads.html#c.PyGILState_STATE
https://docs.python.org/dev/c-api/threads.html#c.PyGILState_Release
Stable ABIhttps://docs.python.org/dev/c-api/stable.html#stable
PyGILState_Ensure()https://docs.python.org/dev/c-api/threads.html#c.PyGILState_Ensure
PyGILState_Ensure()https://docs.python.org/dev/c-api/threads.html#c.PyGILState_Ensure
PyGILState_Release()https://docs.python.org/dev/c-api/threads.html#c.PyGILState_Release
Soft deprecatedhttps://docs.python.org/dev/glossary.html#term-soft-deprecated
PyThreadState_Release()https://docs.python.org/dev/c-api/threads.html#c.PyThreadState_Release
PyThreadStatehttps://docs.python.org/dev/c-api/threads.html#c.PyThreadState
https://docs.python.org/dev/c-api/threads.html#c.PyGILState_GetThisThreadState
Stable ABIhttps://docs.python.org/dev/c-api/stable.html#stable
thread statehttps://docs.python.org/dev/glossary.html#term-thread-state
attachedhttps://docs.python.org/dev/glossary.html#term-attached-thread-state
PyGILState_Ensure()https://docs.python.org/dev/c-api/threads.html#c.PyGILState_Ensure
Soft deprecatedhttps://docs.python.org/dev/glossary.html#term-soft-deprecated
PyThreadState_Get()https://docs.python.org/dev/c-api/threads.html#c.PyThreadState_Get
PyThreadState_GetUnchecked()https://docs.python.org/dev/c-api/threads.html#c.PyThreadState_GetUnchecked
https://docs.python.org/dev/c-api/threads.html#c.PyGILState_Check
attached thread statehttps://docs.python.org/dev/glossary.html#term-attached-thread-state
PyGILState_GetThisThreadState()https://docs.python.org/dev/c-api/threads.html#c.PyGILState_GetThisThreadState
Soft deprecatedhttps://docs.python.org/dev/glossary.html#term-soft-deprecated
https://docs.python.org/dev/c-api/threads.html#cautions-about-fork
os.fork()https://docs.python.org/dev/library/os.html#os.fork
Lock objectshttps://docs.python.org/dev/library/threading.html#lock-objects
PyOS_AfterFork_Child()https://docs.python.org/dev/c-api/sys.html#c.PyOS_AfterFork_Child
os.fork()https://docs.python.org/dev/library/os.html#os.fork
PyThreadStatehttps://docs.python.org/dev/c-api/threads.html#c.PyThreadState
PyInterpreterStatehttps://docs.python.org/dev/c-api/subinterpreters.html#c.PyInterpreterState
“main” interpreterhttps://docs.python.org/dev/c-api/subinterpreters.html#sub-interpreter-support
https://docs.python.org/dev/c-api/threads.html#high-level-apis
https://docs.python.org/dev/c-api/threads.html#c.PyThreadState
Stable ABIhttps://docs.python.org/dev/c-api/stable.html#stable
PyInterpreterStatehttps://docs.python.org/dev/c-api/subinterpreters.html#c.PyInterpreterState
https://docs.python.org/dev/c-api/threads.html#c.PyThreadState.interp
PyThreadStatehttps://docs.python.org/dev/c-api/threads.html#c.PyThreadState
https://docs.python.org/dev/c-api/threads.html#c.PyEval_SaveThread
Stable ABIhttps://docs.python.org/dev/c-api/stable.html#stable
attached thread statehttps://docs.python.org/dev/glossary.html#term-attached-thread-state
thread statehttps://docs.python.org/dev/glossary.html#term-thread-state
PyThreadStatehttps://docs.python.org/dev/c-api/threads.html#c.PyThreadState
https://docs.python.org/dev/c-api/threads.html#c.PyEval_RestoreThread
Stable ABIhttps://docs.python.org/dev/c-api/stable.html#stable
attached thread statehttps://docs.python.org/dev/glossary.html#term-attached-thread-state
thread statehttps://docs.python.org/dev/glossary.html#term-thread-state
Cautions regarding interpreter finalizationhttps://docs.python.org/dev/c-api/interp-lifecycle.html#cautions-regarding-runtime-finalization
PyThreadStatehttps://docs.python.org/dev/c-api/threads.html#c.PyThreadState
https://docs.python.org/dev/c-api/threads.html#c.PyThreadState_Get
Stable ABIhttps://docs.python.org/dev/c-api/stable.html#stable
attached thread statehttps://docs.python.org/dev/glossary.html#term-attached-thread-state
Py_BEGIN_ALLOW_THREADShttps://docs.python.org/dev/c-api/threads.html#c.Py_BEGIN_ALLOW_THREADS
PyThreadState_GetUnchecked()https://docs.python.org/dev/c-api/threads.html#c.PyThreadState_GetUnchecked
PyThreadStatehttps://docs.python.org/dev/c-api/threads.html#c.PyThreadState
https://docs.python.org/dev/c-api/threads.html#c.PyThreadState_GetUnchecked
PyThreadState_Get()https://docs.python.org/dev/c-api/threads.html#c.PyThreadState_Get
PyThreadStatehttps://docs.python.org/dev/c-api/threads.html#c.PyThreadState
PyThreadStatehttps://docs.python.org/dev/c-api/threads.html#c.PyThreadState
https://docs.python.org/dev/c-api/threads.html#c.PyThreadState_Swap
Stable ABIhttps://docs.python.org/dev/c-api/stable.html#stable
attached thread statehttps://docs.python.org/dev/glossary.html#term-attached-thread-state
thread statehttps://docs.python.org/dev/glossary.html#term-thread-state
attached thread statehttps://docs.python.org/dev/glossary.html#term-attached-thread-state
PyEval_ReleaseThread()https://docs.python.org/dev/c-api/threads.html#c.PyEval_ReleaseThread
PyGILState_Ensure()https://docs.python.org/dev/c-api/threads.html#c.PyGILState_Ensure
https://docs.python.org/dev/c-api/threads.html#low-level-apis
PyThreadStatehttps://docs.python.org/dev/c-api/threads.html#c.PyThreadState
PyInterpreterStatehttps://docs.python.org/dev/c-api/subinterpreters.html#c.PyInterpreterState
https://docs.python.org/dev/c-api/threads.html#c.PyThreadState_New
Stable ABIhttps://docs.python.org/dev/c-api/stable.html#stable
attached thread statehttps://docs.python.org/dev/glossary.html#term-attached-thread-state
PyThreadStatehttps://docs.python.org/dev/c-api/threads.html#c.PyThreadState
https://docs.python.org/dev/c-api/threads.html#c.PyThreadState_Clear
Stable ABIhttps://docs.python.org/dev/c-api/stable.html#stable
thread statehttps://docs.python.org/dev/glossary.html#term-thread-state
attachedhttps://docs.python.org/dev/glossary.html#term-attached-thread-state
PyThreadState_Delete()https://docs.python.org/dev/c-api/threads.html#c.PyThreadState_Delete
PyThreadStatehttps://docs.python.org/dev/c-api/threads.html#c.PyThreadState
https://docs.python.org/dev/c-api/threads.html#c.PyThreadState_Delete
Stable ABIhttps://docs.python.org/dev/c-api/stable.html#stable
thread statehttps://docs.python.org/dev/glossary.html#term-thread-state
attachedhttps://docs.python.org/dev/glossary.html#term-attached-thread-state
PyThreadState_Clear()https://docs.python.org/dev/c-api/threads.html#c.PyThreadState_Clear
https://docs.python.org/dev/c-api/threads.html#c.PyThreadState_DeleteCurrent
attached thread statehttps://docs.python.org/dev/glossary.html#term-attached-thread-state
PyThreadState_Clear()https://docs.python.org/dev/c-api/threads.html#c.PyThreadState_Clear
thread statehttps://docs.python.org/dev/glossary.html#term-thread-state
attachedhttps://docs.python.org/dev/glossary.html#term-attached-thread-state
PyFrameObjecthttps://docs.python.org/dev/c-api/frame.html#c.PyFrameObject
PyThreadStatehttps://docs.python.org/dev/c-api/threads.html#c.PyThreadState
https://docs.python.org/dev/c-api/threads.html#c.PyThreadState_GetFrame
Stable ABIhttps://docs.python.org/dev/c-api/stable.html#stable
strong referencehttps://docs.python.org/dev/glossary.html#term-strong-reference
PyEval_GetFrame()https://docs.python.org/dev/c-api/reflection.html#c.PyEval_GetFrame
attachedhttps://docs.python.org/dev/glossary.html#term-attached-thread-state
PyThreadStatehttps://docs.python.org/dev/c-api/threads.html#c.PyThreadState
https://docs.python.org/dev/c-api/threads.html#c.PyThreadState_GetID
Stable ABIhttps://docs.python.org/dev/c-api/stable.html#stable
thread statehttps://docs.python.org/dev/glossary.html#term-thread-state
attachedhttps://docs.python.org/dev/glossary.html#term-attached-thread-state
PyInterpreterStatehttps://docs.python.org/dev/c-api/subinterpreters.html#c.PyInterpreterState
PyThreadStatehttps://docs.python.org/dev/c-api/threads.html#c.PyThreadState
https://docs.python.org/dev/c-api/threads.html#c.PyThreadState_GetInterpreter
Stable ABIhttps://docs.python.org/dev/c-api/stable.html#stable
attachedhttps://docs.python.org/dev/glossary.html#term-attached-thread-state
PyThreadStatehttps://docs.python.org/dev/c-api/threads.html#c.PyThreadState
https://docs.python.org/dev/c-api/threads.html#c.PyThreadState_EnterTracing
PyThreadState_LeaveTracing()https://docs.python.org/dev/c-api/threads.html#c.PyThreadState_LeaveTracing
PyThreadStatehttps://docs.python.org/dev/c-api/threads.html#c.PyThreadState
https://docs.python.org/dev/c-api/threads.html#c.PyThreadState_LeaveTracing
PyThreadState_EnterTracing()https://docs.python.org/dev/c-api/threads.html#c.PyThreadState_EnterTracing
PyEval_SetTrace()https://docs.python.org/dev/c-api/profiling.html#c.PyEval_SetTrace
PyEval_SetProfile()https://docs.python.org/dev/c-api/profiling.html#c.PyEval_SetProfile
PyThreadStatehttps://docs.python.org/dev/c-api/threads.html#c.PyThreadState
https://docs.python.org/dev/c-api/threads.html#c.PyUnstable_ThreadState_SetStackProtection
Unstable APIhttps://docs.python.org/dev/c-api/stable.html#unstable-c-api
recursion controlhttps://docs.python.org/dev/c-api/exceptions.html#recursion
RecursionErrorhttps://docs.python.org/dev/builtins/exceptions.html#RecursionError
Py_EnterRecursiveCall()https://docs.python.org/dev/c-api/exceptions.html#c.Py_EnterRecursiveCall
PyUnstable_ThreadState_SetStackProtection()https://docs.python.org/dev/c-api/threads.html#c.PyUnstable_ThreadState_SetStackProtection
PyUnstable_ThreadState_SetStackProtection()https://docs.python.org/dev/c-api/threads.html#c.PyUnstable_ThreadState_SetStackProtection
PyUnstable_ThreadState_ResetStackProtection()https://docs.python.org/dev/c-api/threads.html#c.PyUnstable_ThreadState_ResetStackProtection
PyThreadStatehttps://docs.python.org/dev/c-api/threads.html#c.PyThreadState
https://docs.python.org/dev/c-api/threads.html#c.PyUnstable_ThreadState_ResetStackProtection
Unstable APIhttps://docs.python.org/dev/c-api/stable.html#unstable-c-api
PyUnstable_ThreadState_SetStackProtection()https://docs.python.org/dev/c-api/threads.html#c.PyUnstable_ThreadState_SetStackProtection
PyObjecthttps://docs.python.org/dev/c-api/structures.html#c.PyObject
https://docs.python.org/dev/c-api/threads.html#c.PyThreadState_GetDict
Stable ABIhttps://docs.python.org/dev/c-api/stable.html#stable
thread statehttps://docs.python.org/dev/glossary.html#term-thread-state
attachedhttps://docs.python.org/dev/glossary.html#term-attached-thread-state
PyThreadStatehttps://docs.python.org/dev/c-api/threads.html#c.PyThreadState
https://docs.python.org/dev/c-api/threads.html#c.PyEval_AcquireThread
Stable ABIhttps://docs.python.org/dev/c-api/stable.html#stable
Attachhttps://docs.python.org/dev/glossary.html#term-attached-thread-state
attached thread statehttps://docs.python.org/dev/glossary.html#term-attached-thread-state
Cautions regarding interpreter finalizationhttps://docs.python.org/dev/c-api/interp-lifecycle.html#cautions-regarding-runtime-finalization
PyEval_RestoreThread()https://docs.python.org/dev/c-api/threads.html#c.PyEval_RestoreThread
Py_END_ALLOW_THREADS()https://docs.python.org/dev/c-api/threads.html#c.Py_END_ALLOW_THREADS
PyGILState_Ensure()https://docs.python.org/dev/c-api/threads.html#c.PyGILState_Ensure
PyEval_RestoreThread()https://docs.python.org/dev/c-api/threads.html#c.PyEval_RestoreThread
PyThreadStatehttps://docs.python.org/dev/c-api/threads.html#c.PyThreadState
https://docs.python.org/dev/c-api/threads.html#c.PyEval_ReleaseThread
Stable ABIhttps://docs.python.org/dev/c-api/stable.html#stable
attached thread statehttps://docs.python.org/dev/glossary.html#term-attached-thread-state
PyEval_SaveThread()https://docs.python.org/dev/c-api/threads.html#c.PyEval_SaveThread
https://docs.python.org/dev/c-api/threads.html#asynchronous-notifications
https://docs.python.org/dev/c-api/threads.html#c.Py_AddPendingCall
Stable ABIhttps://docs.python.org/dev/c-api/stable.html#stable
bytecodehttps://docs.python.org/dev/glossary.html#term-bytecode
attached thread statehttps://docs.python.org/dev/glossary.html#term-attached-thread-state
thread statehttps://docs.python.org/dev/glossary.html#term-attached-thread-state
attached thread statehttps://docs.python.org/dev/glossary.html#term-attached-thread-state
PyThreadState_EnsureFromView()https://docs.python.org/dev/c-api/threads.html#c.PyThreadState_EnsureFromView
https://docs.python.org/dev/c-api/threads.html#c.Py_MakePendingCalls
Stable ABIhttps://docs.python.org/dev/c-api/stable.html#stable
attached thread statehttps://docs.python.org/dev/glossary.html#term-attached-thread-state
PyObjecthttps://docs.python.org/dev/c-api/structures.html#c.PyObject
https://docs.python.org/dev/c-api/threads.html#c.PyThreadState_SetAsyncExc
Stable ABIhttps://docs.python.org/dev/c-api/stable.html#stable
PyThread_get_thread_ident()https://docs.python.org/dev/c-api/threads.html#c.PyThread_get_thread_ident
attached thread statehttps://docs.python.org/dev/glossary.html#term-attached-thread-state
stealhttps://docs.python.org/dev/glossary.html#term-steal
sleep()https://docs.python.org/dev/library/time.html#time.sleep
https://docs.python.org/dev/c-api/threads.html#operating-system-thread-apis
https://docs.python.org/dev/c-api/threads.html#c.PYTHREAD_INVALID_THREAD_ID
https://docs.python.org/dev/c-api/threads.html#c.PyThread_start_new_thread
Stable ABIhttps://docs.python.org/dev/c-api/stable.html#stable
PYTHREAD_INVALID_THREAD_IDhttps://docs.python.org/dev/c-api/threads.html#c.PYTHREAD_INVALID_THREAD_ID
attached thread statehttps://docs.python.org/dev/glossary.html#term-attached-thread-state
https://docs.python.org/dev/c-api/threads.html#c.PyThread_get_thread_ident
Stable ABIhttps://docs.python.org/dev/c-api/stable.html#stable
attached thread statehttps://docs.python.org/dev/glossary.html#term-attached-thread-state
threading.get_ident()https://docs.python.org/dev/library/threading.html#threading.get_ident
threading.Thread.identhttps://docs.python.org/dev/library/threading.html#threading.Thread.ident
PyObjecthttps://docs.python.org/dev/c-api/structures.html#c.PyObject
https://docs.python.org/dev/c-api/threads.html#c.PyThread_GetInfo
Stable ABIhttps://docs.python.org/dev/c-api/stable.html#stable
struct sequencehttps://docs.python.org/dev/c-api/tuple.html#struct-sequence-objects
sys.thread_infohttps://docs.python.org/dev/library/sys.html#sys.thread_info
strong referencehttps://docs.python.org/dev/glossary.html#term-strong-reference
attached thread statehttps://docs.python.org/dev/glossary.html#term-attached-thread-state
https://docs.python.org/dev/c-api/threads.html#c.PY_HAVE_THREAD_NATIVE_ID
https://docs.python.org/dev/c-api/threads.html#c.PyThread_get_thread_native_id
Stable ABIhttps://docs.python.org/dev/c-api/stable.html#stable
PY_HAVE_THREAD_NATIVE_IDhttps://docs.python.org/dev/c-api/threads.html#c.PY_HAVE_THREAD_NATIVE_ID
attached thread statehttps://docs.python.org/dev/glossary.html#term-attached-thread-state
threading.get_native_id()https://docs.python.org/dev/library/threading.html#threading.get_native_id
https://docs.python.org/dev/c-api/threads.html#c.PyThread_exit_thread
Stable ABIhttps://docs.python.org/dev/c-api/stable.html#stable
pthread_exit(3)https://manpages.debian.org/pthread_exit(3)
https://docs.python.org/dev/c-api/threads.html#c.PyThread_init_thread
Stable ABIhttps://docs.python.org/dev/c-api/stable.html#stable
https://docs.python.org/dev/c-api/threads.html#c.PyThread_set_stacksize
Stable ABIhttps://docs.python.org/dev/c-api/stable.html#stable
attached thread statehttps://docs.python.org/dev/glossary.html#term-attached-thread-state
https://docs.python.org/dev/c-api/threads.html#c.PyThread_get_stacksize
Stable ABIhttps://docs.python.org/dev/c-api/stable.html#stable
attached thread statehttps://docs.python.org/dev/glossary.html#term-attached-thread-state
Table of Contentshttps://docs.python.org/dev/contents.html
Thread states and the global interpreter lockhttps://docs.python.org/dev/c-api/threads.html
Detaching the thread state from extension codehttps://docs.python.org/dev/c-api/threads.html#detaching-the-thread-state-from-extension-code
APIshttps://docs.python.org/dev/c-api/threads.html#apis
Using the C API from foreign threadshttps://docs.python.org/dev/c-api/threads.html#using-the-c-api-from-foreign-threads
Reusing a thread state across repeated callshttps://docs.python.org/dev/c-api/threads.html#reusing-a-thread-state-across-repeated-calls
Attaching/detaching thread stateshttps://docs.python.org/dev/c-api/threads.html#attaching-detaching-thread-states
GIL-state APIshttps://docs.python.org/dev/c-api/threads.html#gil-state-apis
Cautions about fork()https://docs.python.org/dev/c-api/threads.html#cautions-about-fork
High-level APIshttps://docs.python.org/dev/c-api/threads.html#high-level-apis
Low-level APIshttps://docs.python.org/dev/c-api/threads.html#low-level-apis
Asynchronous notificationshttps://docs.python.org/dev/c-api/threads.html#asynchronous-notifications
Operating system thread APIshttps://docs.python.org/dev/c-api/threads.html#operating-system-thread-apis
Interpreter initialization and finalizationhttps://docs.python.org/dev/c-api/interp-lifecycle.html
Synchronization primitiveshttps://docs.python.org/dev/c-api/synchronization.html
Report a bughttps://docs.python.org/dev/bugs.html
Improve this pagehttps://docs.python.org/dev/improve-page-nojs.html
Show source https://github.com/python/cpython/blob/main/Doc/c-api/threads.rst?plain=1
indexhttps://docs.python.org/dev/genindex.html
moduleshttps://docs.python.org/dev/py-modindex.html
nexthttps://docs.python.org/dev/c-api/synchronization.html
previoushttps://docs.python.org/dev/c-api/interp-lifecycle.html
Pythonhttps://www.python.org/
3.16.0a2 documentationhttps://docs.python.org/dev/index.html
Python/C API reference manualhttps://docs.python.org/dev/c-api/index.html
Thread states and the global interpreter lockhttps://docs.python.org/dev/c-api/threads.html
Copyrighthttps://docs.python.org/dev/copyright.html
History and Licensehttps://docs.python.org/license.html
Please donate.https://www.python.org/psf/donations/
Found a bughttps://docs.python.org/bugs.html
Sphinxhttps://www.sphinx-doc.org/

Viewport: width=device-width, initial-scale=1.0


URLs of crawlers that visited me.