# PEP 703: Making the Global Interpreter Lock Optional (3.12 updates)

**URL:** <https://discuss.python.org/t/pep-703-making-the-global-interpreter-lock-optional-3-12-updates/26503>\
**Category:** PEPs\
**Created:** [May 4, 2023, 6:22pm UTC](https://discuss.python.org/t/pep-703-making-the-global-interpreter-lock-optional-3-12-updates/26503 "2023-05-04T18:22:11Z")\
**Posts on this page:** 1\
**Showing post:** 1

<div class="post-metadata">

**Author:** ![colesbury](https://sea2.discourse-cdn.com/flex002/user_avatar/discuss.python.org/colesbury/32/28031_2.png) [@colesbury](https://discuss.python.org/u/colesbury)\
**Post date:** [May 4, 2023, 6:22pm UTC](https://discuss.python.org/t/pep-703-making-the-global-interpreter-lock-optional-3-12-updates/26503/1 "2023-05-04T18:22:11Z")

</div>

I’d like to share updates to [PEP 703](https://peps.python.org/pep-0703/). The changes are substantial enough that I figured a new thread was warranted. The main results are from rebasing on to Python 3.12 and include [performance numbers](https://peps.python.org/pep-0703/#performance). That implementation is available at [GitHub - colesbury/nogil-3.12: Multithreaded Python without the GIL (experimental rebase on 3.12)](https://github.com/colesbury/nogil-3.12).

- The PEP is updated to target Python 3.13.
- Tweaks to [biased reference counting](https://peps.python.org/pep-0703/#biased-reference-counting) to avoid an atomic operation in most object deallocations. Essentially, this optimizes further for the case of objects accessed only by a single thread at the cost of some extra overhead when an object is accessed by a non-creating thread.
- Changes to the PyObject [header](https://peps.python.org/pep-0703/#reference-counting) and GC header. With [PEP 683](https://peps.python.org/pep-0683/) accepted and implemented, objects with 2^32-1 references become immortal. This PEP keeps that behavior and shrinks the `ob_ref_local` field to 32-bits (on both 32-bit and 64-bit platforms). The “extra” space is used for a one byte per-object mutex and GC flags (tracked/finalized/immortal), with 16 unused bits. The GC header (`_PyGC_HEAD`) is removed. This makes the total header size for GC-enabled objects the same as in CPython, but non-GC objects are still larger due to the two reference count fields and thread id field.
- The specification of the [`Py_mod_gil`](https://peps.python.org/pep-0703/#py-mod-gil-slot) slot from the previous PEP discussion.

I’d appreciate your feedback on the PEP and the updates.

---

_[View the full topic](https://discuss.python.org/t/pep-703-making-the-global-interpreter-lock-optional-3-12-updates/26503)._
