mirror of
https://github.com/python/cpython.git
synced 2025-11-13 07:26:31 +00:00
Add mention of how to switch interpreters
This commit is contained in:
parent
f1dfe735b5
commit
9bf8d1c228
1 changed files with 3 additions and 1 deletions
|
|
@ -782,7 +782,9 @@ Sub-interpreter support
|
||||||
While in most uses, you will only embed a single Python interpreter, there
|
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
|
are cases where you need to create several independent interpreters in the
|
||||||
same process and perhaps even in the same thread. Sub-interpreters allow
|
same process and perhaps even in the same thread. Sub-interpreters allow
|
||||||
you to do that.
|
you to do that. You can switch between sub-interpreters using the
|
||||||
|
:c:func:`PyThreadState_Swap` function. You can create and destroy them
|
||||||
|
using the following functions:
|
||||||
|
|
||||||
|
|
||||||
.. c:function:: PyThreadState* Py_NewInterpreter()
|
.. c:function:: PyThreadState* Py_NewInterpreter()
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue