René's URL Explorer Experiment


Title: Multiple interpreters in a Python process — Python 3.14.6 documentation

Open Graph Title: Multiple interpreters in a Python process

Description: While in most uses, you will only embed a single Python interpreter, there are cases where you need to create several independent interpreters in the same process and perhaps even in the same threa...

Open Graph Description: While in most uses, you will only embed a single Python interpreter, there are cases where you need to create several independent interpreters in the same process and perhaps even in the same threa...

Opengraph URL: https://docs.python.org/3/c-api/subinterpreters.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.14/_images/social_previews/summary_c-api_subinterpreters_29b0c86e.png
og:image:altWhile in most uses, you will only embed a single Python interpreter, there are cases where you need to create several independent interpreters in the same process and perhaps even in the same threa...
twitter:cardsummary_large_image
theme-color#3776ab
readthedocs-addons-api-version1

Links:

https://www.python.org/
Table of Contentshttps://docs.python.org/3/contents.html
Multiple interpreters in a Python processhttps://docs.python.org/3/c-api/subinterpreters.html
A per-interpreter GILhttps://docs.python.org/3/c-api/subinterpreters.html#a-per-interpreter-gil
Bugs and caveatshttps://docs.python.org/3/c-api/subinterpreters.html#bugs-and-caveats
High-level APIshttps://docs.python.org/3/c-api/subinterpreters.html#high-level-apis
Low-level APIshttps://docs.python.org/3/c-api/subinterpreters.html#low-level-apis
Advanced debugger supporthttps://docs.python.org/3/c-api/subinterpreters.html#advanced-debugger-support
Thread-local storage supporthttps://docs.python.org/3/c-api/tls.html
Profiling and tracinghttps://docs.python.org/3/c-api/profiling.html
Report a bughttps://docs.python.org/3/bugs.html
Improve this pagehttps://docs.python.org/3/improve-page-nojs.html
Show source https://github.com/python/cpython/blob/main/Doc/c-api/subinterpreters.rst?plain=1
indexhttps://docs.python.org/3/genindex.html
moduleshttps://docs.python.org/3/py-modindex.html
nexthttps://docs.python.org/3/c-api/profiling.html
previoushttps://docs.python.org/3/c-api/tls.html
Pythonhttps://www.python.org/
3.14.6 Documentationhttps://docs.python.org/3/index.html
Python/C API reference manualhttps://docs.python.org/3/c-api/index.html
Multiple interpreters in a Python processhttps://docs.python.org/3/c-api/subinterpreters.html
https://docs.python.org/3/c-api/subinterpreters.html#multiple-interpreters-in-a-python-process
PyInterpreterState_Main()https://docs.python.org/3/c-api/subinterpreters.html#c.PyInterpreterState_Main
PyThreadState_Swap()https://docs.python.org/3/c-api/threads.html#c.PyThreadState_Swap
https://docs.python.org/3/c-api/subinterpreters.html#c.PyInterpreterConfig
Py_NewInterpreterFromConfig()https://docs.python.org/3/c-api/subinterpreters.html#c.Py_NewInterpreterFromConfig
https://docs.python.org/3/c-api/subinterpreters.html#c.PyInterpreterConfig.use_main_obmalloc
check_multi_interp_extensionshttps://docs.python.org/3/c-api/subinterpreters.html#c.PyInterpreterConfig.check_multi_interp_extensions
gilhttps://docs.python.org/3/c-api/subinterpreters.html#c.PyInterpreterConfig.gil
PyInterpreterConfig_OWN_GILhttps://docs.python.org/3/c-api/subinterpreters.html#c.PyInterpreterConfig_OWN_GIL
https://docs.python.org/3/c-api/subinterpreters.html#c.PyInterpreterConfig.allow_fork
subprocesshttps://docs.python.org/3/library/subprocess.html#module-subprocess
https://docs.python.org/3/c-api/subinterpreters.html#c.PyInterpreterConfig.allow_exec
os.execv()https://docs.python.org/3/library/os.html#os.execv
subprocesshttps://docs.python.org/3/library/subprocess.html#module-subprocess
https://docs.python.org/3/c-api/subinterpreters.html#c.PyInterpreterConfig.allow_threads
threadinghttps://docs.python.org/3/library/threading.html#module-threading
https://docs.python.org/3/c-api/subinterpreters.html#c.PyInterpreterConfig.allow_daemon_threads
threadinghttps://docs.python.org/3/library/threading.html#module-threading
allow_threadshttps://docs.python.org/3/c-api/subinterpreters.html#c.PyInterpreterConfig.allow_threads
https://docs.python.org/3/c-api/subinterpreters.html#c.PyInterpreterConfig.check_multi_interp_extensions
PEP 489https://peps.python.org/pep-0489/
Py_mod_multiple_interpretershttps://docs.python.org/3/c-api/module.html#c.Py_mod_multiple_interpreters
use_main_obmallochttps://docs.python.org/3/c-api/subinterpreters.html#c.PyInterpreterConfig.use_main_obmalloc
https://docs.python.org/3/c-api/subinterpreters.html#c.PyInterpreterConfig.gil
https://docs.python.org/3/c-api/subinterpreters.html#c.PyInterpreterConfig_DEFAULT_GIL
PyInterpreterConfig_SHARED_GILhttps://docs.python.org/3/c-api/subinterpreters.html#c.PyInterpreterConfig_SHARED_GIL
https://docs.python.org/3/c-api/subinterpreters.html#c.PyInterpreterConfig_SHARED_GIL
https://docs.python.org/3/c-api/subinterpreters.html#c.PyInterpreterConfig_OWN_GIL
PyInterpreterConfig_OWN_GILhttps://docs.python.org/3/c-api/subinterpreters.html#c.PyInterpreterConfig_OWN_GIL
PyInterpreterConfig.use_main_obmallochttps://docs.python.org/3/c-api/subinterpreters.html#c.PyInterpreterConfig.use_main_obmalloc
PyStatushttps://docs.python.org/3/c-api/init_config.html#c.PyStatus
PyThreadStatehttps://docs.python.org/3/c-api/threads.html#c.PyThreadState
PyInterpreterConfighttps://docs.python.org/3/c-api/subinterpreters.html#c.PyInterpreterConfig
https://docs.python.org/3/c-api/subinterpreters.html#c.Py_NewInterpreterFromConfig
builtinshttps://docs.python.org/3/library/builtins.html#module-builtins
__main__https://docs.python.org/3/library/__main__.html#module-__main__
syshttps://docs.python.org/3/library/sys.html#module-sys
thread statehttps://docs.python.org/3/glossary.html#term-thread-state
attachedhttps://docs.python.org/3/glossary.html#term-attached-thread-state
attached thread statehttps://docs.python.org/3/glossary.html#term-attached-thread-state
GILhttps://docs.python.org/3/glossary.html#term-GIL
thread statehttps://docs.python.org/3/glossary.html#term-thread-state
PyInterpreterStatehttps://docs.python.org/3/c-api/subinterpreters.html#c.PyInterpreterState
PyModule_FromDefAndSpec()https://docs.python.org/3/c-api/module.html#c.PyModule_FromDefAndSpec
single-phase initializationhttps://docs.python.org/3/c-api/extension-modules.html#single-phase-initialization
PyModule_Create()https://docs.python.org/3/c-api/module.html#c.PyModule_Create
Bugs and caveatshttps://docs.python.org/3/c-api/subinterpreters.html#bugs-and-caveats
Py_FinalizeEx()https://docs.python.org/3/c-api/interp-lifecycle.html#c.Py_FinalizeEx
Py_Initialize()https://docs.python.org/3/c-api/interp-lifecycle.html#c.Py_Initialize
PyThreadStatehttps://docs.python.org/3/c-api/threads.html#c.PyThreadState
https://docs.python.org/3/c-api/subinterpreters.html#c.Py_NewInterpreter
Stable ABIhttps://docs.python.org/3/c-api/stable.html#stable
Py_NewInterpreterFromConfig()https://docs.python.org/3/c-api/subinterpreters.html#c.Py_NewInterpreterFromConfig
PyThreadStatehttps://docs.python.org/3/c-api/threads.html#c.PyThreadState
https://docs.python.org/3/c-api/subinterpreters.html#c.Py_EndInterpreter
Stable ABIhttps://docs.python.org/3/c-api/stable.html#stable
thread statehttps://docs.python.org/3/glossary.html#term-thread-state
attachedhttps://docs.python.org/3/glossary.html#term-attached-thread-state
Py_FinalizeEx()https://docs.python.org/3/c-api/interp-lifecycle.html#c.Py_FinalizeEx
https://docs.python.org/3/c-api/subinterpreters.html#a-per-interpreter-gil
Py_NewInterpreterFromConfig()https://docs.python.org/3/c-api/subinterpreters.html#c.Py_NewInterpreterFromConfig
PEP 554https://peps.python.org/pep-0554/
PEP 684https://peps.python.org/pep-0684/
immortalhttps://docs.python.org/3/glossary.html#term-immortal
https://docs.python.org/3/c-api/subinterpreters.html#bugs-and-caveats
os.close()https://docs.python.org/3/library/os.html#os.close
PyGILState_Ensure()https://docs.python.org/3/c-api/threads.html#c.PyGILState_Ensure
PyGILState_Release()https://docs.python.org/3/c-api/threads.html#c.PyGILState_Release
ctypeshttps://docs.python.org/3/library/ctypes.html#module-ctypes
https://docs.python.org/3/c-api/subinterpreters.html#high-level-apis
https://docs.python.org/3/c-api/subinterpreters.html#c.PyInterpreterState
Limited APIhttps://docs.python.org/3/c-api/stable.html#stable
PEP 684https://peps.python.org/pep-0684/
per-interpreter GILhttps://docs.python.org/3/c-api/subinterpreters.html#per-interpreter-gil
Py_NewInterpreterFromConfig()https://docs.python.org/3/c-api/subinterpreters.html#c.Py_NewInterpreterFromConfig
PyInterpreterStatehttps://docs.python.org/3/c-api/subinterpreters.html#c.PyInterpreterState
https://docs.python.org/3/c-api/subinterpreters.html#c.PyInterpreterState_Get
Stable ABIhttps://docs.python.org/3/c-api/stable.html#stable
attached thread statehttps://docs.python.org/3/glossary.html#term-attached-thread-state
PyInterpreterStatehttps://docs.python.org/3/c-api/subinterpreters.html#c.PyInterpreterState
https://docs.python.org/3/c-api/subinterpreters.html#c.PyInterpreterState_GetID
Stable ABIhttps://docs.python.org/3/c-api/stable.html#stable
attached thread statehttps://docs.python.org/3/glossary.html#term-attached-thread-state
PyObjecthttps://docs.python.org/3/c-api/structures.html#c.PyObject
PyInterpreterStatehttps://docs.python.org/3/c-api/subinterpreters.html#c.PyInterpreterState
https://docs.python.org/3/c-api/subinterpreters.html#c.PyInterpreterState_GetDict
Stable ABIhttps://docs.python.org/3/c-api/stable.html#stable
PyModule_GetState()https://docs.python.org/3/c-api/module.html#c.PyModule_GetState
PyObjecthttps://docs.python.org/3/c-api/structures.html#c.PyObject
PyThreadStatehttps://docs.python.org/3/c-api/threads.html#c.PyThreadState
_PyInterpreterFramehttps://docs.python.org/3/c-api/frame.html#c._PyInterpreterFrame
https://docs.python.org/3/c-api/subinterpreters.html#c._PyFrameEvalFunction
_PyFrameEvalFunctionhttps://docs.python.org/3/c-api/subinterpreters.html#c._PyFrameEvalFunction
PyInterpreterStatehttps://docs.python.org/3/c-api/subinterpreters.html#c.PyInterpreterState
https://docs.python.org/3/c-api/subinterpreters.html#c._PyInterpreterState_GetEvalFrameFunc
PEP 523https://peps.python.org/pep-0523/
PyInterpreterStatehttps://docs.python.org/3/c-api/subinterpreters.html#c.PyInterpreterState
_PyFrameEvalFunctionhttps://docs.python.org/3/c-api/subinterpreters.html#c._PyFrameEvalFunction
https://docs.python.org/3/c-api/subinterpreters.html#c._PyInterpreterState_SetEvalFrameFunc
PEP 523https://peps.python.org/pep-0523/
https://docs.python.org/3/c-api/subinterpreters.html#low-level-apis
Py_Initialize()https://docs.python.org/3/c-api/interp-lifecycle.html#c.Py_Initialize
Py_Initialize()https://docs.python.org/3/c-api/interp-lifecycle.html#c.Py_Initialize
GILhttps://docs.python.org/3/glossary.html#term-GIL
attached thread statehttps://docs.python.org/3/glossary.html#term-attached-thread-state
PyInterpreterStatehttps://docs.python.org/3/c-api/subinterpreters.html#c.PyInterpreterState
https://docs.python.org/3/c-api/subinterpreters.html#c.PyInterpreterState_New
Stable ABIhttps://docs.python.org/3/c-api/stable.html#stable
attached thread statehttps://docs.python.org/3/glossary.html#term-attached-thread-state
auditing eventhttps://docs.python.org/3/library/sys.html#auditing
PyInterpreterStatehttps://docs.python.org/3/c-api/subinterpreters.html#c.PyInterpreterState
https://docs.python.org/3/c-api/subinterpreters.html#c.PyInterpreterState_Clear
Stable ABIhttps://docs.python.org/3/c-api/stable.html#stable
attached thread statehttps://docs.python.org/3/glossary.html#term-attached-thread-state
auditing eventhttps://docs.python.org/3/library/sys.html#auditing
PyInterpreterStatehttps://docs.python.org/3/c-api/subinterpreters.html#c.PyInterpreterState
https://docs.python.org/3/c-api/subinterpreters.html#c.PyInterpreterState_Delete
Stable ABIhttps://docs.python.org/3/c-api/stable.html#stable
attached thread statehttps://docs.python.org/3/glossary.html#term-attached-thread-state
PyInterpreterState_Clear()https://docs.python.org/3/c-api/subinterpreters.html#c.PyInterpreterState_Clear
https://docs.python.org/3/c-api/subinterpreters.html#advanced-debugger-support
PyInterpreterStatehttps://docs.python.org/3/c-api/subinterpreters.html#c.PyInterpreterState
https://docs.python.org/3/c-api/subinterpreters.html#c.PyInterpreterState_Head
PyInterpreterStatehttps://docs.python.org/3/c-api/subinterpreters.html#c.PyInterpreterState
https://docs.python.org/3/c-api/subinterpreters.html#c.PyInterpreterState_Main
PyInterpreterStatehttps://docs.python.org/3/c-api/subinterpreters.html#c.PyInterpreterState
PyInterpreterStatehttps://docs.python.org/3/c-api/subinterpreters.html#c.PyInterpreterState
https://docs.python.org/3/c-api/subinterpreters.html#c.PyInterpreterState_Next
PyThreadStatehttps://docs.python.org/3/c-api/threads.html#c.PyThreadState
PyInterpreterStatehttps://docs.python.org/3/c-api/subinterpreters.html#c.PyInterpreterState
https://docs.python.org/3/c-api/subinterpreters.html#c.PyInterpreterState_ThreadHead
PyThreadStatehttps://docs.python.org/3/c-api/threads.html#c.PyThreadState
PyThreadStatehttps://docs.python.org/3/c-api/threads.html#c.PyThreadState
PyThreadStatehttps://docs.python.org/3/c-api/threads.html#c.PyThreadState
https://docs.python.org/3/c-api/subinterpreters.html#c.PyThreadState_Next
PyInterpreterStatehttps://docs.python.org/3/c-api/subinterpreters.html#c.PyInterpreterState
Table of Contentshttps://docs.python.org/3/contents.html
Multiple interpreters in a Python processhttps://docs.python.org/3/c-api/subinterpreters.html
A per-interpreter GILhttps://docs.python.org/3/c-api/subinterpreters.html#a-per-interpreter-gil
Bugs and caveatshttps://docs.python.org/3/c-api/subinterpreters.html#bugs-and-caveats
High-level APIshttps://docs.python.org/3/c-api/subinterpreters.html#high-level-apis
Low-level APIshttps://docs.python.org/3/c-api/subinterpreters.html#low-level-apis
Advanced debugger supporthttps://docs.python.org/3/c-api/subinterpreters.html#advanced-debugger-support
Thread-local storage supporthttps://docs.python.org/3/c-api/tls.html
Profiling and tracinghttps://docs.python.org/3/c-api/profiling.html
Report a bughttps://docs.python.org/3/bugs.html
Improve this pagehttps://docs.python.org/3/improve-page-nojs.html
Show source https://github.com/python/cpython/blob/main/Doc/c-api/subinterpreters.rst?plain=1
indexhttps://docs.python.org/3/genindex.html
moduleshttps://docs.python.org/3/py-modindex.html
nexthttps://docs.python.org/3/c-api/profiling.html
previoushttps://docs.python.org/3/c-api/tls.html
Pythonhttps://www.python.org/
3.14.6 Documentationhttps://docs.python.org/3/index.html
Python/C API reference manualhttps://docs.python.org/3/c-api/index.html
Multiple interpreters in a Python processhttps://docs.python.org/3/c-api/subinterpreters.html
Copyrighthttps://docs.python.org/3/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.