October DealsAmazon USOctober deal check: compare before you payAmazon US: current deals, useful picks and tech finds.Check DealsPC HealthRecommendedCrashes, freezes, slowdowns? Check your PC nowSpot repairable issues before they interrupt work.Check PCOctober DealsAmazon USDeal season is back - check today's better picksAmazon US: current deals, useful picks and tech finds.See Picks×
Skip to content
World desk5 min

Python’s GIL: What Changed When Free-Threading Opened a New Lane

CPython’s optional free-threaded build opens the possibility of parallel Python threads, but the standard build still uses the GIL—and extensions, workload, and thread safety matter.
Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Python did not simply remove its Global Interpreter Lock (GIL). CPython added an optional free-threaded build in Python 3.13, letting supported programs run Python threads in parallel across CPU cores. The standard build still enables the GIL, and free-threaded mode brings compatibility and performance trade-offs.

What the GIL does—and what it does not

The Global Interpreter Lock is a synchronization mechanism in CPython, the most widely used Python implementation. In a conventional CPython interpreter, a thread must hold the GIL to access Python objects through the interpreter and C API. This helps protect shared interpreter state and object operations; without suitable synchronization, for example, concurrent reference-count updates could be lost. The CPython 3.13 C API documentation explains the lock and its role.

As an Amazon Associate I earn from qualifying purchases.

The practical limit is narrower than “Python threads cannot run in parallel.” In a GIL-enabled interpreter, only one thread at a time executes Python code, so CPU-bound Python work cannot use multiple cores through threads in the same way. But the interpreter releases the GIL around blocking I/O, and extensions can release it around native computations that do not need Python objects. Other threads can make progress during those intervals. The GIL is a CPython design choice, not a rule that every Python implementation must follow.

What’s actually slowing this PC down?

Pick the symptom - the matching free tool is one click away.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Why the change took decades to reach mainstream CPython

The highway metaphor describes a long-running engineering challenge, not a claim that free-threading became technically imaginable only recently. PEP 703 recounts a GIL-removing patch for Python 1.4 published by Greg Stein in 1996. Later efforts included Adam Olsen’s python-safethread patch, Trent Nelson’s PyParallel fork, and Larry Hastings’s Gilectomy. These projects differed in design and aims, but they illustrate that removing a global lock has been discussed for years.

The hard part was making the option viable in the main interpreter while addressing reference counting, object safety, performance, and compatibility with C extensions. Sam Gross proposed the modern --disable-gil build configuration in PEP 703, sponsored by Łukasz Langa. The Steering Council accepted the proposal on 24 October 2023 with a gradual-rollout proviso and the possibility of rollback if the change proved too disruptive. The proposal also anticipated separate ABIs for GIL-enabled and free-threaded builds, adding work for packaging and extension maintainers. PEP 703 describes the proposal, its history, and its staged adoption.

What “the highway opened” means in Python 3.13 and later

Python 3.13 introduced a free-threaded CPython build, configured from source with --disable-gil. It is an option, not the default: the ordinary CPython build still enables the GIL. The Python 3.14 free-threading guide says official macOS and Windows installers optionally provide free-threaded builds as well. Availability therefore depends on the Python version and how it was installed.

With the GIL disabled, a suitably designed application may run Python threads in parallel on available CPU cores. That can improve throughput or reduce latency for some workloads, but free-threading is not a universal speed switch. Some code needs redesign to benefit and avoid performance pitfalls. The Python documentation summarizes the potential as “Free-threaded execution allows for full utilization of the available processing power by running threads in parallel on available CPU cores.” The free-threading guide covers build options, runtime behavior, and compatibility.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

How to check whether your interpreter is actually free-threaded

  1. Check the build and runtime status using the current interpreter. The free-threading guide documents python -VV, sys.version, and sys._is_gil_enabled() as ways to inspect version and GIL status. For example, run python -VV in the same environment that launches your program; in Python code, inspect sys.version and call sys._is_gil_enabled() where available.

  2. Check whether the interpreter was built with free-threading support. The guide identifies the Py_GIL_DISABLED build configuration variable. A free-threading-capable build is not proof that the GIL remains disabled at runtime.

  3. Review imported C extensions. An extension that does not explicitly declare free-threading support may cause the interpreter to enable the GIL when it is imported. Recheck runtime status after loading the packages your application uses.

What changes for extensions and shared data

Package and extension compatibility

Free-threaded execution changes assumptions that extensions may make about the GIL protecting Python objects. Check that critical C extensions explicitly support free threading, and verify actual runtime behavior: importing an unsupported extension can turn the GIL back on. The separate ABI for free-threaded builds also means package availability and maintenance may differ from the ordinary build.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Application-level thread safety

Without the GIL’s broad serialization, shared mutable state needs deliberate synchronization. Built-in containers such as lists, dictionaries, and sets have internal protection for certain concurrent modifications, but Python recommends using explicit synchronization primitives rather than relying on those implementation locks as an application’s thread-safety design.

Use tools such as threading.Lock to protect shared state, and make the protected operation clear: a sequence of reads and writes that must remain consistent should be guarded as a unit. Internal container protection does not make arbitrary multi-step application logic atomic.

Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

What the performance trade-off looks like

Free-threading offers potential parallel scaling, but its single-thread performance cost matters when a program does not gain enough from additional cores. PEP 779 reported a linear-performance penalty for the free-threaded build of around 10% on Linux and Windows and around 3% on macOS in the comparisons described there. Those are PEP-reported comparisons, not fixed results for every workload or a guarantee about current releases. The PEP frames free-threading as a staged rollout intended to establish real-world benefits alongside the costs in performance, support burden, and ecosystem complexity. PEP 779 sets out the criteria and trade-offs for free-threaded Python’s supported status.

As the PEP puts it: “It’s not a simple drop-in solution – some code will have to be redesigned to make the most of the new capability, as well as avoid performance pitfalls – but it can achieve higher performance, significantly lower latency and new thread-based functionality when embraced.”

Free tools Windows power users keep installed

One-click scans. No signup required.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

How to decide whether to use it

Compare the options against your application rather than choosing based on the build name alone:

  • Workload: Free-threading is most relevant when work can be divided across threads and CPU cores. Blocking I/O already lets threads make progress in a conventional build, so measure whether the new mode addresses your bottleneck.
  • Performance balance: Weigh parallel gains against the single-thread cost. Benchmark representative tasks on the operating system and Python build you plan to deploy.
  • Dependencies: Confirm that essential extensions support free-threaded execution, then check whether importing them leaves the GIL disabled.
  • Thread safety: Audit shared mutable state and add explicit locks or other synchronization where needed; do not treat built-in container locks as a complete concurrency strategy.
  • Deployment and support: Account for how your distribution supplies the build and for the separate ABI and ecosystem support burden.

For many programs, the conventional build remains the straightforward choice. Free-threaded CPython creates a new option for workloads and dependency stacks that can use it; it does not make every threaded Python program faster or remove the need to design for concurrency.

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.

Leave a Reply

Your email address will not be published. Required fields are marked *

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

More from the Wire

  1. World desk4 min
    How to Spot an AI Voice Scam Before Sending MoneyDon’t rely on how a caller sounds. Pause, call back through a known number, and verify the emergency with another trusted person before sending money.
  2. Mountain View desk4 min
    Google’s SynthID Detector: How to Check AI-Generated Images, Video and AudioGoogle’s SynthID Detector looks for an embedded watermark in supported images, video and audio. Here is what its results do—and do not—show.
  3. Redmond desk20 min
    How to create a link to File or Folder in Windows 11Windows 11 gives you several ways to point to a file or folder without moving or duplicating it. You can create a desktop shortcut,…
Recommended PC Tool
Recommended PC Tool
Windows Errors? Fix Them Before They SpreadFree repair scan
Crashes, No Sound, or Screen Glitches?Free driver scan

Two free Windows tools

One Free Minute Could Fix That PC

Before you go - each of these free tools takes about a minute and tackles what quietly slows a Windows PC down.

Special offer. View Outbyte info, uninstall instructions, EULA, and Privacy Policy.