From: Miss Islington (bot) <31488909+miss-islington@users.noreply.github.com> Date: Thu, 11 Sep 2025 09:23:24 +0000 (+0200) Subject: [3.14] gh-138644: Update c-api docs of `PyInterpreterState` about PEP-684 (GH-138651... X-Git-Tag: v3.14.0rc3~34 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=47441f0874f5586dc612cd26bf6567ec11c59e5b;p=thirdparty%2FPython%2Fcpython.git [3.14] gh-138644: Update c-api docs of `PyInterpreterState` about PEP-684 (GH-138651) (#138657) Co-authored-by: sobolevn Co-authored-by: Peter Bierma --- diff --git a/Doc/c-api/init.rst b/Doc/c-api/init.rst index d34502f50b53..6a272a4f5fcb 100644 --- a/Doc/c-api/init.rst +++ b/Doc/c-api/init.rst @@ -1184,6 +1184,12 @@ code, or when embedding the Python interpreter: interpreter lock is also shared by all threads, regardless of to which interpreter they belong. + .. versionchanged:: 3.12 + + :pep:`684` introduced the possibility + of a :ref:`per-interpreter GIL `. + See :c:func:`Py_NewInterpreterFromConfig`. + .. c:type:: PyThreadState @@ -1875,6 +1881,8 @@ function. You can create and destroy them using the following functions: haven't been explicitly destroyed at that point. +.. _per-interpreter-gil: + A Per-Interpreter GIL --------------------- @@ -1886,7 +1894,7 @@ being blocked by other interpreters or blocking any others. Thus a single Python process can truly take advantage of multiple CPU cores when running Python code. The isolation also encourages a different approach to concurrency than that of just using threads. -(See :pep:`554`.) +(See :pep:`554` and :pep:`684`.) Using an isolated interpreter requires vigilance in preserving that isolation. That especially means not sharing any objects or mutable