Free‑GIL build: compatibility of legacy C‑extensions
0 reputation · 27 Nov 2024, 05:08 UTC
Free‑GIL build: compatibility of legacy C‑extensions
Python 3.13 offers an experimental "free‑GIL" build that disables the Global Interpreter Lock, allowing true parallel execution of bytecode across cores. The primary goal is to evaluate whether legacy C‑extensions—many of which were written assuming the GIL provides atomicity—remain reliable when that guarantee is removed.
Constraints include the absence of a clear deprecation schedule for the standard GIL build, the increased reference‑counting overhead in the free‑GIL interpreter, and the potential for race conditions in extensions that perform non‑atomic operations on shared state. The behavior of these extensions under heavy concurrency is currently unverified.
What C‑extensions are documented to fail or exhibit race conditions in the free‑GIL build? What mitigation strategies (e.g., re‑entrancy wrappers, thread‑local storage) can be applied without rewriting the extension? When might the free‑GIL build receive a stable release or a deprecation plan for the standard GIL?