You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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!
The text was updated successfully, but these errors were encountered:
Refcounting always uses biased refcounting in the free-threaded build, with the potentital associated changes in lifetimes. (Some objects may live longer than they would normally. I don't think this is likely to come up very often)
Mimalloc is always used so there are still the limitations on the memory allocator mentioned in the PEP
IMO, everything under the --disable-gil build should be considered experimental. Every implementation detail can be changed in a future version, and even behavior details can be changed.
And the following command says everything for the status too :)
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:
It also mentions that free-threaded execution:
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: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!
The text was updated successfully, but these errors were encountered: