Skip to content

docs: show nogil in most examples #5770

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 1 commit into from
Jul 28, 2025

Conversation

henryiii
Copy link
Collaborator

@henryiii henryiii commented Jul 27, 2025

Now that free-threading is no longer experimental, I think we should either always show it, or switch the default to on with a way to opt-out instead. Always showing it doesn't require a bump, so maybe we do that for now?


Created using mini-swe-agent and the propmt:

I'd like to find usages of PYBIND11_MODULE in the docs folder and add py::mod_gil_not_used() as a third argument if there ar
e only two arguments. These are examples, and it's really a good idea to always include that now.

I removed a few of the changes.

Signed-off-by: Henry Schreiner [email protected]

Description

Suggested changelog entry:

  • Placeholder.

📚 Documentation preview 📚: https://pybind11--5770.org.readthedocs.build/

Created using [mini-swe-agent](https://mini-swe-agent.com) and the propmt:

I'd like to find usages of PYBIND11_MODULE in the docs folder and add py::mod_gil_not_used() as a third argument if there ar
e only two arguments. These are examples, and it's really a good idea to always include that now.

I removed a few of the changes.

Signed-off-by: Henry Schreiner <[email protected]>
@rwgk
Copy link
Collaborator

rwgk commented Jul 27, 2025

@b-pass Here is another Python 3.12 tlock.locked() flake:

https://github.com/pybind/pybind11/actions/runs/16547614513/job/46797808085?pr=5770

cd /home/runner/work/pybind11/pybind11/build/tests/test_embed && /home/runner/work/pybind11/pybind11/build/tests/test_embed/test_embed
Exception ignored in: <module 'threading' from '/opt/hostedtoolcache/Python/3.12.11/x64/lib/python3.12/threading.py'>
Traceback (most recent call last):
  File "/opt/hostedtoolcache/Python/3.12.11/x64/lib/python3.12/threading.py", line 1602, in _shutdown
    assert tlock.locked()
           ^^^^^^^^^^^^^^
AssertionError: 
munmap_chunk(): invalid pointer

@henryiii henryiii merged commit 6972597 into pybind:master Jul 28, 2025
145 of 146 checks passed
@henryiii henryiii deleted the henryiii/docs/nogilexamples branch July 28, 2025 05:08
@github-actions github-actions bot added the needs changelog Possibly needs a changelog entry label Jul 28, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs changelog Possibly needs a changelog entry
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants