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

iTechGuides is reader-supported. When you buy through links on our site, we may earn an affiliate commission. As an Amazon Associate I earn from qualifying purchases. Learn more

Python did not suddenly eliminate its Global Interpreter Lock (GIL). CPython 3.13 introduced an optional free-threaded build that can let Python threads run in parallel across CPU cores; the standard build still enables the GIL by default. Whether the new lane helps depends on the workload, installed extensions, and how the program protects shared data.

What the GIL did—and what it did not do

The Global Interpreter Lock is a synchronization mechanism in CPython, not a requirement for every Python implementation. In conventional CPython, a thread must hold the GIL to access Python objects through the interpreter and C API. That protects shared interpreter state and object operations; without synchronization, for example, concurrent reference-count updates could be lost. Python 3.13 C API documentation

Because only one thread at a time holds that lock, conventional CPython threads cannot execute Python code simultaneously on multiple cores. But “Python threads cannot do anything in parallel” is too broad: CPython releases the GIL around blocking I/O, and extensions can release it during native computations that do not need Python objects. Other threads can make progress while one thread waits or performs such work. Python 3.13 C API documentation

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

Why opening this lane took decades

The idea of removing the GIL is older than the current change. PEP 703 recounts that Greg Stein published a GIL-removal patch for Python 1.4 in 1996. Later efforts included Adam Olsen’s python-safethread patch, Trent Nelson’s PyParallel fork, and Larry Hastings’s Gilectomy. They were distinct projects, not one continuous implementation; collectively, they show that removing a global lock was a longstanding idea, while making it viable in mainstream CPython required confronting object safety, reference counting, compatibility, and performance. PEP 703, related work

Sam Gross proposed a --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 plan also meant separate ABIs for GIL and free-threaded builds, adding work for packaging and extension maintainers. PEP 703

What changed in Python 3.13 and later

CPython has supported free-threaded builds since Python 3.13. These builds are optional: the usual CPython build continues to have the GIL enabled by default. The Python 3.14 documentation says official macOS and Windows installers optionally provide free-threaded builds; building from source uses --disable-gil. Availability can therefore depend on the operating system and how Python was installed. Python 3.14 free-threading guide

Free-threaded execution is intended to let threads use available CPU cores in parallel. As the Python documentation puts it, “Free-threaded execution allows for full utilization of the available processing power by running threads in parallel on available CPU cores.” That describes the capability, not a guaranteed speedup for every program. Python 3.14 free-threading guide

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

A free-threaded build and a disabled GIL are related but not identical conditions: the guide notes that the GIL can be turned on at runtime. It also may be enabled automatically when the interpreter imports a C extension that does not explicitly support free threading. Check both the build and runtime state before attributing behavior to free-threaded execution. Python 3.14 free-threading guide

  1. Run python -VV to inspect the interpreter’s version and build information.
  2. In Python, inspect sys.version for version and build details.
  3. Where available, call sys._is_gil_enabled() to check whether the GIL is currently enabled.
  4. For build configuration, check Py_GIL_DISABLED. A free-threading build does not by itself prove the GIL remains disabled after imports.
  5. Review the C extensions your application imports and their free-threading support declarations; an incompatible extension may turn the GIL back on.

The guide documents these checks and the extension behavior; consult it for details relevant to your Python version and installation. Python 3.14 free-threading guide

When free-threading may help—and what it costs

Applications with work that can be divided among threads may benefit from parallel execution, but switching builds is not a universal speed setting. The Python project’s PEP 779 describes free-threaded Python as requiring some code to be redesigned to benefit from the capability and avoid performance pitfalls. It says the approach can offer higher performance, lower latency, and new thread-based functionality when embraced. PEP 779

PEP 779 reported a linear-performance penalty for the free-threaded build of around 10% on Linux and Windows and around 3% on macOS, compared with a build with the GIL. These are the PEP’s reported comparisons, not fixed current results or predictions for an individual application; workload and environment matter. PEP 779

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
  • Potential gain: CPU-bound threaded work may use multiple cores when the program and its dependencies support free threading.
  • Potential cost: the free-threaded build can carry a performance penalty, and not every workload scales with more parallelism.
  • Compatibility factor: C extensions need explicit free-threading support; an unsupported extension may enable the GIL.
  • Maintenance factor: code that shares mutable state across threads needs a deliberate synchronization design.

Why thread safety still needs attention

Free-threaded Python does not make every concurrent operation safe. Built-in lists, dictionaries, and sets have internal protection for certain concurrent modifications, but the Python documentation recommends explicit synchronization rather than relying on those implementation-level locks. Use tools such as threading.Lock to protect shared mutable application state and to make multi-step operations safe as a whole. Python 3.14 free-threading guide

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

A practical way to choose

Compare a free-threaded build with the conventional GIL-enabled build using the application you intend to run. The relevant decision is not simply whether Python can use multiple cores, but whether your code can use them safely and whether the benefit outweighs compatibility and performance costs.

  1. Identify the workload. Determine whether the work is CPU-bound and can be divided across threads, or whether it spends substantial time waiting on I/O.
  2. Confirm the interpreter state. Establish which build you installed and whether the GIL is disabled at runtime.
  3. Audit dependencies. Check whether the application’s C extensions support free threading and whether importing them changes GIL state.
  4. Review shared state. Add explicit synchronization where threads access mutable data concurrently; do not treat built-in container locks as an application-level concurrency plan.
  5. Compare on your target environment. Test the GIL-enabled and free-threaded builds on the operating system, package set, and workload you actually deploy, considering both scaling and single-thread costs.

PEP 779 frames this as a staged rollout: real-world benefits must be weighed against performance costs, support burden, and ecosystem complexity. Its central qualification is that free-threaded Python is not a drop-in solution: some programs need redesign to make use of it and avoid performance pitfalls. PEP 779

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.

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