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, from the previous two chapters. It covers the proposal that removes the GIL, how the CPython project is rolling it out, and what "supported" means today.
What PEP 703 proposes
PEP 703, "Making the Global Interpreter Lock Optional in CPython", was written by Sam Gross. It does not delete the GIL. It adds a second build of CPython in which the GIL can be absent. The standard build stays as it is.
The proposal needed changes to several parts of the interpreter. Chapter 12 covers them in detail. In short:
- Reference counting becomes thread-safe, using a biased scheme that is cheap for objects only one thread touches.
- Some objects become immortal, so their counts never change.
- The memory allocator is replaced with one that works across threads (mimalloc).
- Built-in containers such as
dictandlistget fine-grained internal locks.
The Python Steering Council accepted the PEP in July 2023. It attached a condition: the change must roll out in phases, and the project must be able to back out if the ecosystem suffers.
The three phases
The rollout is described in terms of three phases. The diagram shows the order and the version where each phase began.
| Phase | Status | Python version |
|---|---|---|
| I | Experimental build, not recommended for production | 3.13 (October 2024) |
| II | Officially supported, still optional | 3.14 (October 2025) |
| III | Free-threaded becomes the default | Not decided |
Moving from Phase I to Phase II required a second proposal, PEP 779, "Criteria for supported status for free-threaded Python". It set conditions such as stable APIs, acceptable performance, and a working ecosystem. Python 3.14 met them.
What "supported" means today
In Python 3.14, the free-threaded build is a supported, separate build. It is not the default, and you still choose it deliberately. Three points matter in practice:
- Single-threaded code pays a cost. The free-threaded build is slower than the standard build on single-threaded code. In 3.13 the gap was larger because the specializing adaptive interpreter was disabled. In 3.14 that optimization works in the free-threaded build, and PEP 779 puts the remaining overhead at roughly 5 to 10 percent. Measure your own workload before relying on that number.
- The ecosystem is still catching up. Many popular packages publish free-threaded wheels, but not all of them do. A package that has not declared support can force the GIL back on when you import it (see chapter 11).
- Phase III has no date. The project has said it will decide on making free-threading the default only after enough real-world evidence. Do not plan around a particular release.
Checking your own situation
Before adopting free-threading, ask three questions. Which Python version can you run? Do your dependencies ship free-threaded wheels? Is your workload CPU-bound and parallelizable enough to benefit? The next chapters show how to detect the build and measure the answers.
Exercise
Python 3.14 made free-threaded CPython "supported". Name two things that this status does not guarantee.
Show answer
It does not make the free-threaded build the default, because that is Phase III and has no date. It does not guarantee that your dependencies or your own code work correctly. Packages may lack free-threaded support, and code that relied on the GIL can have data races. Single-threaded code also still runs somewhat slower than on the standard build.