Skip to content

Request for Clarification on Experimental Status of Free-Threaded Builds with GIL in CPython 3.13 #124287

Closed
@briensea

Description

@briensea

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:

  1. 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?
  2. 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!

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions