summaryrefslogtreecommitdiffstats
path: root/Misc/python.man
diff options
context:
space:
mode:
authorBrett Simmers <swtaarrs@users.noreply.github.com>2024-03-11 15:02:58 (GMT)
committerGitHub <noreply@github.com>2024-03-11 15:02:58 (GMT)
commit2731913dd5234ff5ab630a3b7f1c98ad79d4d9df (patch)
treec666bae1112581bf0fe4c23ced8d188082cbcefd /Misc/python.man
parent546eb7a3be241c5abd8a83cebbbab8c71107edcf (diff)
downloadcpython-2731913dd5234ff5ab630a3b7f1c98ad79d4d9df.zip
cpython-2731913dd5234ff5ab630a3b7f1c98ad79d4d9df.tar.gz
cpython-2731913dd5234ff5ab630a3b7f1c98ad79d4d9df.tar.bz2
gh-116167: Allow disabling the GIL with `PYTHON_GIL=0` or `-X gil=0` (#116338)
In free-threaded builds, running with `PYTHON_GIL=0` will now disable the GIL. Follow-up issues track work to re-enable the GIL when loading an incompatible extension, and to disable the GIL by default. In order to support re-enabling the GIL at runtime, all GIL-related data structures are initialized as usual, and disabling the GIL simply sets a flag that causes `take_gil()` and `drop_gil()` to return early.
Diffstat (limited to 'Misc/python.man')
-rw-r--r--Misc/python.man4
1 files changed, 4 insertions, 0 deletions
diff --git a/Misc/python.man b/Misc/python.man
index 0f5dfa2..4c90c0e 100644
--- a/Misc/python.man
+++ b/Misc/python.man
@@ -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