From 43a06426791e8324ad002bc64ca29b30a6a385ac Mon Sep 17 00:00:00 2001 From: Brett Simmers Date: Mon, 13 May 2024 13:43:35 -0700 Subject: [PATCH 1/2] Add central references to free-threading-related options --- Doc/c-api/module.rst | 4 ++-- Doc/using/cmdline.rst | 5 +++-- Doc/using/configure.rst | 3 ++- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/Doc/c-api/module.rst b/Doc/c-api/module.rst index 6fe1ce9e994832..63e3bed6727987 100644 --- a/Doc/c-api/module.rst +++ b/Doc/c-api/module.rst @@ -427,14 +427,14 @@ The available slot types are: This slot is ignored by Python builds not configured with :option:`--disable-gil`. Otherwise, it determines whether or not importing this module will cause the GIL to be automatically enabled. See - :envvar:`PYTHON_GIL` and :option:`-X gil <-X>` for more detail. + :ref:`free-threaded-cpython` for more detail. Multiple ``Py_mod_gil`` slots may not be specified in one module definition. If ``Py_mod_gil`` is not specified, the import machinery defaults to ``Py_MOD_GIL_USED``. - .. versionadded: 3.13 + .. versionadded:: 3.13 See :PEP:`489` for more details on multi-phase initialization. diff --git a/Doc/using/cmdline.rst b/Doc/using/cmdline.rst index 2d95fa9474033f..0620f7d7114ba5 100644 --- a/Doc/using/cmdline.rst +++ b/Doc/using/cmdline.rst @@ -616,7 +616,8 @@ Miscellaneous options * :samp:`-X gil={0,1}` forces the GIL to be disabled or enabled, respectively. Only available in builds configured with - :option:`--disable-gil`. See also :envvar:`PYTHON_GIL`. + :option:`--disable-gil`. See also :envvar:`PYTHON_GIL` and + :ref:`free-threaded-cpython`. .. versionadded:: 3.13 @@ -1206,7 +1207,7 @@ conflict. forced on. Setting it to ``0`` forces the GIL off. See also the :option:`-X gil <-X>` command-line option, which takes - precedence over this variable. + precedence over this variable, and :ref:`free-threaded-cpython`. Needs Python configured with the :option:`--disable-gil` build option. diff --git a/Doc/using/configure.rst b/Doc/using/configure.rst index d30356d2058eff..e99ac2076d93f4 100644 --- a/Doc/using/configure.rst +++ b/Doc/using/configure.rst @@ -299,7 +299,8 @@ General Options Defines the ``Py_GIL_DISABLED`` macro and adds ``"t"`` to :data:`sys.abiflags`. - See :pep:`703` "Making the Global Interpreter Lock Optional in CPython". + See :pep:`703` "Making the Global Interpreter Lock Optional in CPython" and + :ref:`free-threaded-cpython`. .. versionadded:: 3.13 From b44c42365747853ffffdc2ae29b94b15a06f6c65 Mon Sep 17 00:00:00 2001 From: Brett Simmers Date: Tue, 21 May 2024 00:17:37 -0700 Subject: [PATCH 2/2] Move PEP 703 reference to free-threaded-cpython section --- Doc/using/configure.rst | 3 +-- Doc/whatsnew/3.13.rst | 3 ++- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Doc/using/configure.rst b/Doc/using/configure.rst index e99ac2076d93f4..428ee5275276a0 100644 --- a/Doc/using/configure.rst +++ b/Doc/using/configure.rst @@ -299,8 +299,7 @@ General Options Defines the ``Py_GIL_DISABLED`` macro and adds ``"t"`` to :data:`sys.abiflags`. - See :pep:`703` "Making the Global Interpreter Lock Optional in CPython" and - :ref:`free-threaded-cpython`. + See :ref:`free-threaded-cpython` for more detail. .. versionadded:: 3.13 diff --git a/Doc/whatsnew/3.13.rst b/Doc/whatsnew/3.13.rst index 8cd174f01ff600..7edfdd4f8167a0 100644 --- a/Doc/whatsnew/3.13.rst +++ b/Doc/whatsnew/3.13.rst @@ -368,7 +368,8 @@ CPython will run with the :term:`global interpreter lock` (GIL) disabled when configured using the ``--disable-gil`` option at build time. This is an experimental feature and therefore isn't used by default. Users need to either compile their own interpreter, or install one of the experimental -builds that are marked as *free-threaded*. +builds that are marked as *free-threaded*. See :pep:`703` "Making the Global +Interpreter Lock Optional in CPython" for more detail. Free-threaded execution allows for full utilization of the available processing power by running threads in parallel on available CPU cores.