Sub topic 3
PEP 703 and where free-threaded Python stands
This chapter assumes you know what the GIL is and why it limits CPU-bound threads (covered in the previous two chapters). It also assumes you have used threading or concurrent.futures. Here you will learn what PEP 703 proposes, how the Steering Council accepted it, which phase the project is in, and how to read that status when deciding whether to depend on free-threaded Python.
Why a PEP was needed
Removing the GIL is not a patch to one module. The GIL is an assumption built into the interpreter, the C API, and thousands of extension modules. Reference counts, the memory allocator, dictionaries, lists, and the garbage collector all rely on the fact that only one thread runs bytecode at a time. Changing that assumption affects every part of CPython and every extension written against it.
Earlier attempts failed for this reason. Removing the lock was possible, but the result ran single-threaded code much more slowly or broke existing extensions. The proposal that changed the discussion came from Sam Gross, whose nogil fork showed that a design could scale across cores while keeping single-thread slowdowns manageable. PEP 703, "Making the Global Interpreter Lock Optional in CPython", turned that work into a formal proposal. It asks the core team to accept a long-term maintenance cost, so it needed a decision at the governance level.
What PEP 703 proposes
The title is the key point: the GIL becomes optional, not removed. PEP 703 proposes:
- A build-time option (
--disable-gilinconfigure) that produces a separate interpreter without the GIL. - A second build that coexists with the standard one. The standard build keeps the GIL.
- Interpreter changes that make the no-GIL build safe, such as biased reference counting, immortal objects, and a different memory allocator (covered in a later chapter).
- A new C API surface so extensions can declare that they are safe without the GIL.
The two builds differ in the ABI, the binary interface that compiled extensions rely on. An extension compiled for the standard build does not load into the free-threaded build, and the reverse holds too. Wheels for the free-threaded build carry their own tag (for example cp313t), and package authors must publish them separately.
How the proposal was accepted
The Python Steering Council announced in July 2023 that it would accept PEP 703. The acceptance came with conditions, which is the most important thing to understand about the project's status. The council did not approve a switch. It approved a gradual rollout with the option to stop.
The conditions include:
- The work proceeds in phases, and each phase has to be justified before the next begins.
- The core team can roll back the change if it proves too disruptive for the community.
- The no-GIL build must not cause serious regressions for users of the standard build.
- The project is expected to support the community in porting key libraries.
This explains why the free-threaded interpreter has been described with changing words over time: "experimental", then "supported but optional", and later possibly "default".
The three phases
PEP 703 describes three phases. The table shows each phase, what it means for you, and where Python stands.
| Phase | Meaning | Status |
|---|---|---|
| I | Free-threaded build is experimental. It exists to let the community test it. | Python 3.13 (October 2024) |
| II | Free-threaded build is officially supported but optional. The standard build remains the default. | Python 3.14 (October 2025) |
| III | Free-threaded build becomes the default build, and the GIL build is eventually phased out. | No date set |
Phase II was not granted automatically. PEP 779, "Criteria for supported status for free-threaded Python", set measurable conditions that the build had to meet first. Among them were limits on the performance cost and extra memory use compared with the standard build. As I recall the numbers, the limits were about 15% slower on single-threaded benchmarks and about 20% more memory. Check the PEP itself for the exact thresholds. PEP 779 also requires that the free-threaded build remain stable enough that it will not be removed without a deprecation period.
Phase III has no schedule. The core team has said that moving to it depends on how much of the ecosystem works well without the GIL. That depends on extension authors, not only on CPython.
What changed between 3.13 and 3.14
Both versions have a free-threaded build, but they are not equivalent. The 3.13 build was a preview. In particular, it disabled the specializing adaptive interpreter, which is the part of CPython that speeds up hot bytecode by replacing generic instructions with type-specific ones. Without it, single-threaded code in the 3.13 free-threaded build ran noticeably slower than on the standard build.
Python 3.14 made the specializing interpreter work in the free-threaded build, which narrowed the single-thread gap considerably. It also improved the C API for extensions and moved parts of the standard library toward thread-safe behavior. Treat any performance figure you read online as tied to a specific version and workload. A benchmark from 3.13 may not describe 3.14 at all.
Checking what you are running
Status matters at runtime because two things are independent: whether the interpreter is a free-threaded build, and whether the GIL is currently enabled in it. The code below reports both. It also handles interpreters older than 3.13, where sys._is_gil_enabled does not exist.
import sys
import sysconfig
print("Version:", sys.version.split()[0])
# 1 on a free-threaded build, 0 or None on a standard build
print("Free-threaded build:", sysconfig.get_config_var("Py_GIL_DISABLED"))
# sys._is_gil_enabled() was added in Python 3.13
is_gil_enabled = getattr(sys, "_is_gil_enabled", None)
if is_gil_enabled is None:
print("GIL enabled: True (this Python predates 3.13)")
else:
print("GIL enabled:", is_gil_enabled())On a standard 3.12 interpreter the last line reports that the GIL is enabled because of the version. On a standard 3.14 interpreter, Py_GIL_DISABLED is 0 and the GIL is enabled. On python3.14t it is 1, and the GIL is disabled unless something re-enabled it.
Common misunderstandings
These are the errors that tend to appear when people read about "Python without the GIL".
- "Python 3.14 has no GIL." The default
python3.14still has it. Only the separately built, separately installed free-threaded interpreter (usually named with at) runs without it by default. - "Free-threaded means all my code is now faster." Code that does not use threads gets no speedup. It often runs somewhat slower, because the free-threaded build pays extra costs for thread-safe reference counting and allocation.
- "Phase II means the GIL is gone for good." Phase II means the build is supported. It says nothing about whether it becomes the default. That decision belongs to Phase III.
- "If the build has no GIL, the GIL is always off." An extension that is not marked as safe can cause the interpreter to turn the GIL back on while the program runs. The rule is covered in a later chapter. This is why you check
sys._is_gil_enabled()at runtime rather than trusting the build alone. - "Removing the GIL makes my code thread-safe." The GIL never made your compound operations atomic. For example,
counter += 1was already a race in standard CPython. Without the GIL, such races show up more often and more reliably, because threads truly run at the same time. - "My wheel installed, so it supports free-threading." Pip may install a standard-build wheel in some configurations through compatibility behavior, and an extension may import and silently re-enable the GIL. Always verify with the runtime check.
Judging readiness for your project
The status of the PEP tells you what the CPython team supports. It does not tell you whether your own program benefits. A practical way to decide:
- If your workload is CPU-bound, uses threads, and shares large data between workers, the free-threaded build is worth testing now. Threads avoid the copying that multiprocessing needs.
- If your workload is I/O-bound, the GIL was never the bottleneck, and you gain little.
- If you depend on many compiled extensions, check each one for free-threaded wheels and for declared support before you commit.
- If you ship software to users who control their own Python, expect the standard build to remain the common target for some time.
Later chapters cover how to test extensions, how to measure the performance cost, and how to compare threads with processes.
Exercise
A teammate says, "PEP 703 was accepted in 2023, so python3.14 runs without the GIL by default." Give two corrections, and name one runtime check that would show whether the GIL is actually active.
Show answer
First, PEP 703 made the GIL optional through a separate build, and the Steering Council accepted it with conditions and a phased rollout. It did not remove the GIL from the default interpreter. Second, in Python 3.14 the free-threaded build is supported (Phase II) but optional, and the default python3.14 still has the GIL. Becoming the default is Phase III, which has no date. To check the active state, call sys._is_gil_enabled(). It returns False only when the GIL is off in the running interpreter. sysconfig.get_config_var("Py_GIL_DISABLED") tells you whether the build is free-threaded, but not whether an extension has re-enabled the GIL.