|
1 | 1 | .. _freethreading-python-howto:
|
2 | 2 |
|
3 |
| -********************************************** |
4 |
| -Python experimental support for free threading |
5 |
| -********************************************** |
| 3 | +********************************* |
| 4 | +Python support for free threading |
| 5 | +********************************* |
6 | 6 |
|
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 |
8 | 8 | Python called :term:`free threading` where the :term:`global interpreter lock`
|
9 | 9 | (GIL) is disabled. Free-threaded execution allows for full utilization of the
|
10 | 10 | available processing power by running threads in parallel on available CPU cores.
|
11 | 11 | While not all software will benefit from this automatically, programs
|
12 | 12 | designed with threading in mind will run faster on multi-core hardware.
|
13 | 13 |
|
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`. |
16 | 19 |
|
17 | 20 | This document describes the implications of free threading
|
18 | 21 | for Python code. See :ref:`freethreading-extensions-howto` for information on
|
@@ -43,7 +46,7 @@ Identifying free-threaded Python
|
43 | 46 | ================================
|
44 | 47 |
|
45 | 48 | 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". |
47 | 50 | The new :func:`sys._is_gil_enabled` function can be used to check whether
|
48 | 51 | the GIL is actually disabled in the running process.
|
49 | 52 |
|
|
0 commit comments