8000 gh-116167: Allow disabling the GIL with `PYTHON_GIL=0` or `-X gil=0` by swtaarrs · Pull Request #116338 · python/cpython · GitHub
[go: up one dir, main page]

Skip to content

gh-116167: Allow disabling the GIL with PYTHON_GIL=0 or -X gil=0 #116338

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 11 commits into from
Mar 11, 2024
Merged
Prev Previous commit
Next Next commit
Document PYTHON_GIL environment variable
  • Loading branch information
swtaarrs committed Mar 6, 2024
commit 505366159ce85c638bb24906a29fa0b59c0a6357
9 changes: 9 additions & 0 deletions Doc/using/cmdline.rst
Original file line number Diff line number Diff line change
Expand Up @@ -1147,6 +1147,15 @@ conflict.

.. versionadded:: 3.13

.. envvar:: PYTHON_GIL

If this variable is set to ``1``, the global interpreter lock (GIL) will be
forced on. Setting it to ``0`` forces the GIL off.

Needs Python configured with the :option:`--disable-gil` build option.

.. versionadded:: 3.13

Debug-mode variables
~~~~~~~~~~~~~~~~~~~~

Expand Down
4 changes: 4 additions & 0 deletions Misc/python.man
Original file line number Diff line number Diff line change
Expand Up @@ -607,6 +607,10 @@ output. Setting it to 0 deactivates this behavior.
.IP PYTHON_HISTORY
This environment variable can be used to set the location of a history file
(on Unix, it is \fI~/.python_history\fP by default).
.IP PYTHON_GIL
If this variable is set to 1, the global interpreter lock (GIL) will be forced
on. Setting it to 0 forces the GIL off. Only available in builds configured
with \fB--disable-gil\fP.
.SS Debug-mode variables
Setting these variables only has an effect in a debug build of Python, that is,
if Python was configured with the
Expand Down
0