Skip to content

Commit 9410113

Browse files
miss-islingtoncorona10hugovkZeroIntensityYhg1s
authored
[3.14] gh-119132: Remove "experimental" tag from the CPython free-threading. (gh-135550) (gh-135565)
--------- (cherry picked from commit f079979) Co-authored-by: Donghee Na <[email protected]> Co-authored-by: Hugo van Kemenade <[email protected]> Co-authored-by: Peter Bierma <[email protected]> Co-authored-by: T. Wouters <[email protected]>
1 parent 2ef78a8 commit 9410113

File tree

11 files changed

+23
-19
lines changed

11 files changed

+23
-19
lines changed

Doc/howto/free-threading-extensions.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@
66
C API Extension Support for Free Threading
77
******************************************
88

9-
Starting with the 3.13 release, CPython has experimental support for running
10-
with the :term:`global interpreter lock` (GIL) disabled in a configuration
9+
Starting with the 3.13 release, CPython has support for running with
10+
the :term:`global interpreter lock` (GIL) disabled in a configuration
1111
called :term:`free threading`. This document describes how to adapt C API
1212
extensions to support free threading.
1313

Doc/howto/free-threading-python.rst

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,21 @@
11
.. _freethreading-python-howto:
22

3-
**********************************************
4-
Python experimental support for free threading
5-
**********************************************
3+
*********************************
4+
Python support for free threading
5+
*********************************
66

7-
Starting with the 3.13 release, CPython has experimental support for a build of
7+
Starting with the 3.13 release, CPython has support for a build of
88
Python called :term:`free threading` where the :term:`global interpreter lock`
99
(GIL) is disabled. Free-threaded execution allows for full utilization of the
1010
available processing power by running threads in parallel on available CPU cores.
1111
While not all software will benefit from this automatically, programs
1212
designed with threading in mind will run faster on multi-core hardware.
1313

14-
**The free-threaded mode is experimental** and work is ongoing to improve it:
15-
expect some bugs and a substantial single-threaded performance hit.
14+
The free-threaded mode is working and continues to be improved, but
15+
there is some additional overhead in single-threaded workloads compared
16+
to the regular build. Additionally, third-party packages, in particular ones
17+
with an :term:`extension module`, may not be ready for use in a
18+
free-threaded build, and will re-enable the :term:`GIL`.
1619

1720
This document describes the implications of free threading
1821
for Python code. See :ref:`freethreading-extensions-howto` for information on
@@ -43,7 +46,7 @@ Identifying free-threaded Python
4346
================================
4447

4548
To check if the current interpreter supports free-threading, :option:`python -VV <-V>`
46-
and :data:`sys.version` contain "experimental free-threading build".
49+
and :data:`sys.version` contain "free-threading build".
4750
The new :func:`sys._is_gil_enabled` function can be used to check whether
4851
the GIL is actually disabled in the running process.
4952

Doc/library/ctypes.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -882,7 +882,7 @@ invalid non-\ ``NULL`` pointers would crash Python)::
882882
Thread safety without the GIL
883883
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
884884

885-
In Python 3.13, the :term:`GIL` may be disabled on :term:`experimental free threaded <free threading>` builds.
885+
From Python 3.13 onward, the :term:`GIL` can be disabled on :term:`free threaded <free threading>` builds.
886886
In ctypes, reads and writes to a single object concurrently is safe, but not across multiple objects:
887887

888888
.. code-block:: pycon

Doc/library/threading.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ CPU-bound tasks, as only one thread can execute Python bytecode at a time.
102102
Despite this, threads remain a useful tool for achieving concurrency in many
103103
scenarios.
104104

105-
As of Python 3.13, experimental :term:`free-threaded <free threading>` builds
105+
As of Python 3.13, :term:`free-threaded <free threading>` builds
106106
can disable the GIL, enabling true parallel execution of threads, but this
107107
feature is not available by default (see :pep:`703`).
108108

Doc/using/configure.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -290,8 +290,8 @@ General Options
290290

291291
.. option:: --disable-gil
292292

293-
Enables **experimental** support for running Python without the
294-
:term:`global interpreter lock` (GIL): free threading build.
293+
Enables support for running Python without the :term:`global interpreter
294+
lock` (GIL): free threading build.
295295

296296
Defines the ``Py_GIL_DISABLED`` macro and adds ``"t"`` to
297297
:data:`sys.abiflags`.

Lib/platform.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1198,7 +1198,7 @@ def _sys_version(sys_version=None):
11981198
# CPython
11991199
cpython_sys_version_parser = re.compile(
12001200
r'([\w.+]+)\s*' # "version<space>"
1201-
r'(?:experimental free-threading build\s+)?' # "free-threading-build<space>"
1201+
r'(?:free-threading build\s+)?' # "free-threading-build<space>"
12021202
r'\(#?([^,]+)' # "(#buildno"
12031203
r'(?:,\s*([\w ]*)' # ", builddate"
12041204
r'(?:,\s*([\w :]*))?)?\)\s*' # ", buildtime)<space>"
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Remove "experimental" tag from the CPython free-threading build.

PCbuild/build.bat

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ echo. -k Attempt to kill any running Pythons before building (usually done
3333
echo. automatically by the pythoncore project)
3434
echo. --pgo Build with Profile-Guided Optimization. This flag
3535
echo. overrides -c and -d
36-
echo. --disable-gil Enable experimental support for running without the GIL.
36+
echo. --disable-gil Enable support for running without the GIL.
3737
echo. --test-marker Enable the test marker within the build.
3838
echo. --regen Regenerate all opcodes, grammar and tokens.
3939
echo. --experimental-jit Enable the experimental just-in-time compiler.

Python/getversion.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ void _Py_InitVersion(void)
1515
}
1616
initialized = 1;
1717
#ifdef Py_GIL_DISABLED
18-
const char *buildinfo_format = "%.80s experimental free-threading build (%.80s) %.80s";
18+
const char *buildinfo_format = "%.80s free-threading build (%.80s) %.80s";
1919
#else
2020
const char *buildinfo_format = "%.80s (%.80s) %.80s";
2121
#endif

configure

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

configure.ac

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1716,7 +1716,7 @@ ABI_THREAD=""
17161716
# --disable-gil
17171717
AC_MSG_CHECKING([for --disable-gil])
17181718
AC_ARG_ENABLE([gil],
1719-
[AS_HELP_STRING([--disable-gil], [enable experimental support for running without the GIL (default is no)])],
1719+
[AS_HELP_STRING([--disable-gil], [enable support for running without the GIL (default is no)])],
17201720
[AS_VAR_IF([enable_gil], [yes], [disable_gil=no], [disable_gil=yes])], [disable_gil=no]
17211721
)
17221722
AC_MSG_RESULT([$disable_gil])

0 commit comments

Comments
 (0)