Description
Documentation
I’ve been exploring the documentation on free-threaded builds in CPython 3.13, specifically around the use of the --disable-gil
option during build configuration.
The documentation states:
--disable-gil
enables experimental support for running Python without the Global Interpreter Lock (GIL): free-threading build.
(Source: Python 3.13 Configuration)
It also mentions that free-threaded execution:
allows for full utilization of available CPU cores by running threads in parallel. The mode is experimental, with some expected bugs and a substantial single-threaded performance hit. Free-threaded builds support optionally running with the GIL enabled at runtime using the environment variable
PYTHON_GIL
or the command-line option-X gil
.
(Source: What's New in Python 3.13)
However, it's unclear whether a free-threaded build with the GIL enabled (either via the PYTHON_GIL
environment variable or -X gil
option) should still be considered experimental. My specific questions are:
- Is enabling the GIL at runtime (in a free-threaded build) still part of the experimental feature set, or is this a more stable pathway for Python 3.13?
- Are there any known limitations or issues when running a free-threaded build with the GIL enabled, in contrast to the standard GIL-enabled CPython build?
I’ve been unable to find a clear answer to this and would appreciate any additional insights or clarifications on this point.
Thank you for your time and for all the great work on Python!