Skip to content

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

Merged
ericsnowcurrently merged 8 commits into
python:mainfrom
ericsnowcurrently:module-def-slot-supports-interpreters
May 5, 2023
Merged

ericsnowcurrently merged 8 commits into
python:mainfrom
ericsnowcurrently:module-def-slot-supports-interpreters

Conversation

@ericsnowcurrently

@ericsnowcurrently ericsnowcurrently commented May 3, 2023 •

Copy link
Copy Markdown
Member

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

@ericsnowcurrently

ericsnowcurrently commented May 4, 2023 •

Copy link
Copy Markdown
Member Author

FYI, I plan on adding a test for this.

[done]

@ericsnowcurrently

Copy link
Copy Markdown
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.

@erlend-aasland erlend-aasland left a comment

Copy link
Copy Markdown
Contributor

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
Copy Markdown
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 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

3 participants