Skip to content
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

gh-104108: Add the Py_mod_multiple_interpreters Module Def Slot #104148

Conversation

ericsnowcurrently
Copy link
Member

@ericsnowcurrently ericsnowcurrently commented May 3, 2023

I'll be adding a value to indicate support for per-interpreter GIL in gh-99114.

@ericsnowcurrently
Copy link
Member Author

ericsnowcurrently commented May 4, 2023

FYI, I plan on adding a test for this.

[done]

@ericsnowcurrently
Copy link
Member Author

Any objections to this PR? It's blocking the per-interpreter GIL PR, so I'd like to merge it as soon as possible.

Copy link
Contributor

@erlend-aasland erlend-aasland left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Apart from docs missing, this looks good to me.

@ericsnowcurrently
Copy link
Member Author

I'm going to circle back to the docs after feature freeze.

@ericsnowcurrently ericsnowcurrently merged commit 1c420e1 into python:main May 5, 2023
@ericsnowcurrently ericsnowcurrently deleted the module-def-slot-supports-interpreters branch May 5, 2023 20:05
carljm added a commit to carljm/cpython that referenced this pull request May 5, 2023
* main:
  pythongh-99113: Add PyInterpreterConfig.own_gil (pythongh-104204)
  pythongh-104146: Remove unused var 'parser_body_declarations' from clinic.py (python#104214)
  pythongh-99113: Add Py_MOD_PER_INTERPRETER_GIL_SUPPORTED (pythongh-104205)
  pythongh-104108: Add the Py_mod_multiple_interpreters Module Def Slot (pythongh-104148)
  pythongh-99113: Share the GIL via PyInterpreterState.ceval.gil (pythongh-104203)
  pythonGH-100479: Add `pathlib.PurePath.with_segments()` (pythonGH-103975)
  pythongh-69152: Add _proxy_response_headers attribute to HTTPConnection (python#26152)
  pythongh-103533: Use PEP 669 APIs for cprofile (pythonGH-103534)
  pythonGH-96803: Add three C-API functions to make _PyInterpreterFrame less opaque for users of PEP 523. (pythonGH-96849)
jbower-fb pushed a commit to jbower-fb/cpython-jbowerfb that referenced this pull request May 8, 2023
…pythongh-104148)

I'll be adding a value to indicate support for per-interpreter GIL in pythongh-99114.
ericsnowcurrently added a commit that referenced this pull request Nov 6, 2023
…MITED_API (gh-111707)

This should have been done in gh-104148.

(A similar fix has already be done for that slot's value macros, and backported to 3.12.  See gh-110968.)
miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Nov 6, 2023
… Py_LIMITED_API (pythongh-111707)

This should have been done in pythongh-104148.

(A similar fix has already be done for that slot's value macros, and backported to 3.12.  See pythongh-110968.)
(cherry picked from commit 836e0a7)

Co-authored-by: Eric Snow <ericsnowcurrently@gmail.com>
hugovk pushed a commit to hugovk/cpython that referenced this pull request Nov 8, 2023
… Py_LIMITED_API (pythongh-111707)

This should have been done in pythongh-104148.

(A similar fix has already be done for that slot's value macros, and backported to 3.12.  See pythongh-110968.)
ericsnowcurrently added a commit that referenced this pull request Nov 28, 2023
…r Py_LIMITED_API (gh-111707) (gh-111787)

This should have been done in gh-104148.

(A similar fix has already be done for that slot's value macros, and backported to 3.12.  See gh-110968.)
(cherry picked from commit 836e0a7)

Co-authored-by: Eric Snow <ericsnowcurrently@gmail.com>
aisk pushed a commit to aisk/cpython that referenced this pull request Feb 11, 2024
… Py_LIMITED_API (pythongh-111707)

This should have been done in pythongh-104148.

(A similar fix has already be done for that slot's value macros, and backported to 3.12.  See pythongh-110968.)
colesbury pushed a commit that referenced this pull request May 3, 2024
This PR adds the ability to enable the GIL if it was disabled at
interpreter startup, and modifies the multi-phase module initialization
path to enable the GIL when loading a module, unless that module's spec
includes a slot indicating it can run safely without the GIL.

PEP 703 called the constant for the slot `Py_mod_gil_not_used`; I went
with `Py_MOD_GIL_NOT_USED` for consistency with gh-104148.

A warning will be issued up to once per interpreter for the first
GIL-using module that is loaded. If `-v` is given, a shorter message
will be printed to stderr every time a GIL-using module is loaded
(including the first one that issues a warning).
SonicField pushed a commit to SonicField/cpython that referenced this pull request May 8, 2024
This PR adds the ability to enable the GIL if it was disabled at
interpreter startup, and modifies the multi-phase module initialization
path to enable the GIL when loading a module, unless that module's spec
includes a slot indicating it can run safely without the GIL.

PEP 703 called the constant for the slot `Py_mod_gil_not_used`; I went
with `Py_MOD_GIL_NOT_USED` for consistency with pythongh-104148.

A warning will be issued up to once per interpreter for the first
GIL-using module that is loaded. If `-v` is given, a shorter message
will be printed to stderr every time a GIL-using module is loaded
(including the first one that issues a warning).
Glyphack pushed a commit to Glyphack/cpython that referenced this pull request Sep 2, 2024
… Py_LIMITED_API (pythongh-111707)

This should have been done in pythongh-104148.

(A similar fix has already be done for that slot's value macros, and backported to 3.12.  See pythongh-110968.)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants