FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

gh-126316: Use mutexes in the grp module by vstinner · Pull Request #126504 · python/cpython · GitHub

Repository navigation

gh-126316: Use mutexes in the grp module - #126504

Closed
vstinner wants to merge 2 commits into
python:mainfrom
vstinner:grp_mutex
Closed

vstinner wants to merge 2 commits into
python:mainfrom
vstinner:grp_mutex

Conversation

vstinner commented Nov 6, 2024 •
edited by bedevere-app Bot
Loading

Copy link
Copy Markdown
Member

vstinner added the needs backport to 3.13 only security fixes label Nov 6, 2024
bedevere-app Bot mentioned this pull request Nov 6, 2024

Copy link
Copy Markdown
Member

Actually, we'll need a separate fix for subinterpreters on 3.12, because there's no PyMutex there.

…BcDse.rst

Co-authored-by: Peter Bierma <zintensitydev@gmail.com>

vstinner commented Nov 6, 2024

Copy link
Copy Markdown
Member Author

Actually, we'll need a separate fix for subinterpreters on 3.12, because there's no PyMutex there.

The regular build (not Free Threaded build) is not affected by #126316 since function calls are serialized by the GIL.

Copy link
Copy Markdown
Member

Yeah, but a subinterpreter can have its own GIL, so if these functions aren't thread safe on a system level, then it won't be thread safe across multiple interpreters. I think we just need to add a Py_mod_multiple_interpreters module slot with Py_MOD_MULTIPLE_INTERPRETERS_SUPPORTED, to indicate that subinterpreters need to use a shared GIL to use the module.

vstinner commented Nov 6, 2024

Copy link
Copy Markdown
Member Author

Yeah, but a subinterpreter can have its own GIL, so if these functions aren't thread safe on a system level, then it won't be thread safe across multiple interpreters.

My change only fix free-threaded build. Should I also change the regular build for this use case?

Copy link
Copy Markdown
Member

On second thought, I think we should address subinterpreters in another PR for backporting reasons. The fix is what I said with the module slot above.

Copy link
Copy Markdown
Member Author

#127055 was merged instead. I close this issue.

vstinner closed this Nov 21, 2024
vstinner deleted the grp_mutex branch November 21, 2024 14:48
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants


Back | FazBrowse Home | New Git URL