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

gh-100227: Isolate the Import State to Each Interpreter by ericsnowcurrently · Pull Request #101941 · python/cpython · GitHub

/ cpython Public

gh-100227: Isolate the Import State to Each Interpreter - #101941

Merged
ericsnowcurrently merged 3 commits into
python:mainfrom
ericsnowcurrently:isolate-import-state
Mar 9, 2023
Merged

gh-100227: Isolate the Import State to Each Interpreter#101941
ericsnowcurrently merged 3 commits into
python:mainfrom
ericsnowcurrently:isolate-import-state

Conversation

ericsnowcurrently commented Feb 15, 2023
edited by bedevere-bot
Loading

Copy link
Copy Markdown
Member

Specific changes:

  • move the import lock to PyInterpreterState
  • move the "find_and_load" diagnostic state to PyInterpreterState

Note that the import lock exists to keep multiple imports of the same module in the same interpreter (but in different threads) from stomping on each other. Independently, we use a distinct global lock to protect globally shared import state, especially related to loaded extension modules. For now we can rely on the GIL as that lock but with a per-interpreter GIL we'll need a new global lock.

The remaining state in _PyRuntimeState.imports will continue being global.

corona10 added the 🔨 test-with-refleak-buildbots Test PR w/ refleak buildbots; report in status section label Feb 16, 2023

Copy link
Copy Markdown

🤖 New build scheduled with the buildbot fleet by @corona10 for commit 0dbb320 🤖

If you want to schedule another build, you need to add the 🔨 test-with-refleak-buildbots label again.

bedevere-bot removed the 🔨 test-with-refleak-buildbots Test PR w/ refleak buildbots; report in status section label Feb 16, 2023

Copy link
Copy Markdown
Member Author

FYI, I ran the benchmarks on this and it reported a 1% speedup, which wasn't expected. :)

ericsnowcurrently merged commit cf6e7c5 into python:main Mar 9, 2023
ericsnowcurrently deleted the isolate-import-state branch March 9, 2023 16:46
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.

3 participants


Back | FazBrowse Home | New Git URL