Skip to content

Conversation

@miss-islington
Copy link
Contributor

@miss-islington miss-islington commented Oct 13, 2024

Currently, the "global interpreter lock" entry in the glossary mentions
that -X gil 0 can be used to disable the GIL 1. However, this is
invalid; the correct usage should be -X gil=0.

$ python -X gil 0 -c 'print("Hello, world")'
Fatal Python error: config_read_gil: PYTHON_GIL / -X gil must be "0" or "1"
Python runtime state: preinitialized

$ python -X gil=0 -c 'print("Hello, world")'
Hello, world

(cherry picked from commit a8fa4ad)

Co-authored-by: Ruoyu Zhong [email protected]
Signed-off-by: Ruoyu Zhong [email protected]


📚 Documentation preview 📚: https://cpython-previews--125382.org.readthedocs.build/

Currently, the "global interpreter lock" entry in the glossary mentions
that `-X gil 0` can be used to disable the GIL [1]. However, this is
invalid; the correct usage should be `-X gil=0`.

    $ python -X gil 0 -c 'print("Hello, world")'
    Fatal Python error: config_read_gil: PYTHON_GIL / -X gil must be "0" or "1"
    Python runtime state: preinitialized

    $ python -X gil=0 -c 'print("Hello, world")'
    Hello, world

[1]: https://docs.python.org/3/using/cmdline.htmlGH-cmdoption-X

(cherry picked from commit a8fa4ad)

Co-authored-by: Ruoyu Zhong <[email protected]>
Signed-off-by: Ruoyu Zhong <[email protected]>
@AA-Turner AA-Turner enabled auto-merge (squash) October 13, 2024 00:53
@AA-Turner AA-Turner merged commit e47dd93 into python:3.13 Oct 13, 2024
32 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

docs Documentation in the Doc dir skip issue skip news

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants