mirror of
https://github.com/python/cpython.git
synced 2025-09-26 18:29:57 +00:00
[3.12] gh-107306: Add a Doc Entry for Py_mod_multiple_interpreters (GH-107403) (gh-107521)
gh-107306: Add a Doc Entry for Py_mod_multiple_interpreters (GH-107403)
It was added in 3.12 for PEP 684 (per-interpreter GIL).
(cherry picked from commit fb344e99aa
)
Co-authored-by: Eric Snow <ericsnowcurrently@gmail.com>
This commit is contained in:
parent
fd60855299
commit
3f6afafa7e
3 changed files with 34 additions and 0 deletions
|
@ -1555,6 +1555,7 @@ function. You can create and destroy them using the following functions:
|
||||||
in any thread where the sub-interpreter is currently active.
|
in any thread where the sub-interpreter is currently active.
|
||||||
Otherwise only multi-phase init extension modules
|
Otherwise only multi-phase init extension modules
|
||||||
(see :pep:`489`) may be imported.
|
(see :pep:`489`) may be imported.
|
||||||
|
(Also see :c:macro:`Py_mod_multiple_interpreters`.)
|
||||||
|
|
||||||
This must be ``1`` (non-zero) if
|
This must be ``1`` (non-zero) if
|
||||||
:c:member:`~PyInterpreterConfig.use_main_obmalloc` is ``0``.
|
:c:member:`~PyInterpreterConfig.use_main_obmalloc` is ``0``.
|
||||||
|
|
|
@ -376,6 +376,37 @@ The available slot types are:
|
||||||
If multiple ``Py_mod_exec`` slots are specified, they are processed in the
|
If multiple ``Py_mod_exec`` slots are specified, they are processed in the
|
||||||
order they appear in the *m_slots* array.
|
order they appear in the *m_slots* array.
|
||||||
|
|
||||||
|
.. c:macro:: Py_mod_multiple_interpreters
|
||||||
|
|
||||||
|
Specifies one of the following values:
|
||||||
|
|
||||||
|
.. c:macro:: Py_MOD_MULTIPLE_INTERPRETERS_NOT_SUPPORTED
|
||||||
|
|
||||||
|
The module does not support being imported in subinterpreters.
|
||||||
|
|
||||||
|
.. c:macro:: Py_MOD_MULTIPLE_INTERPRETERS_SUPPORTED
|
||||||
|
|
||||||
|
The module supports being imported in subinterpreters,
|
||||||
|
but only when they share the main interpreter's GIL.
|
||||||
|
(See :ref:`isolating-extensions-howto`.)
|
||||||
|
|
||||||
|
.. c:macro:: Py_MOD_PER_INTERPRETER_GIL_SUPPORTED
|
||||||
|
|
||||||
|
The module supports being imported in subinterpreters,
|
||||||
|
even when they have their own GIL.
|
||||||
|
(See :ref:`isolating-extensions-howto`.)
|
||||||
|
|
||||||
|
This slot determines whether or not importing this module
|
||||||
|
in a subinterpreter will fail.
|
||||||
|
|
||||||
|
Multiple ``Py_mod_multiple_interpreters`` slots may not be specified
|
||||||
|
in one module definition.
|
||||||
|
|
||||||
|
If ``Py_mod_multiple_interpreters`` is not specified, the import
|
||||||
|
machinery defaults to ``Py_MOD_MULTIPLE_INTERPRETERS_NOT_SUPPORTED``.
|
||||||
|
|
||||||
|
.. versionadded:: 3.12
|
||||||
|
|
||||||
See :PEP:`489` for more details on multi-phase initialization.
|
See :PEP:`489` for more details on multi-phase initialization.
|
||||||
|
|
||||||
Low-level module creation functions
|
Low-level module creation functions
|
||||||
|
|
|
@ -1,5 +1,7 @@
|
||||||
.. highlight:: c
|
.. highlight:: c
|
||||||
|
|
||||||
|
.. _isolating-extensions-howto:
|
||||||
|
|
||||||
***************************
|
***************************
|
||||||
Isolating Extension Modules
|
Isolating Extension Modules
|
||||||
***************************
|
***************************
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue