Skip to content

gh-81057: Move Threading-Related Globals to _PyRuntimeState #100084

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

Conversation

ericsnowcurrently
Copy link
Member

@ericsnowcurrently ericsnowcurrently commented Dec 7, 2022

@netlify
Copy link

netlify bot commented Dec 7, 2022

Deploy Preview for python-cpython-preview ready!

Name Link
🔨 Latest commit 3c22543
🔍 Latest deploy log https://app.netlify.com/sites/python-cpython-preview/deploys/6392802b0234d300086d75f9
😎 Deploy Preview https://deploy-preview-100084--python-cpython-preview.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site settings.

@kumaraditya303
Copy link
Contributor

How about changing the thread initializer PyThread_init_thread to be always called on startup? It will eliminate these globals altogether be threadsafe so will help in per interpreter GIL too.

@ericsnowcurrently
Copy link
Member Author

ericsnowcurrently commented Dec 8, 2022

It's called when the GIL is created, which is already a part of initializing the main interpreter. Perhaps I misunderstood what you meant?

@ericsnowcurrently ericsnowcurrently added the 🔨 test-with-buildbots Test PR w/ buildbots; report in status section label Dec 8, 2022
@bedevere-bot
Copy link

🤖 New build scheduled with the buildbot fleet by @ericsnowcurrently for commit f05396b 🤖

If you want to schedule another build, you need to add the ":hammer: test-with-buildbots" label again.

@bedevere-bot bedevere-bot removed the 🔨 test-with-buildbots Test PR w/ buildbots; report in status section label Dec 8, 2022
@ericsnowcurrently ericsnowcurrently force-pushed the consolidate-threading-globals branch from f05396b to 3c22543 Compare December 9, 2022 00:24
@ericsnowcurrently ericsnowcurrently merged commit 1160001 into python:main Dec 9, 2022
@ericsnowcurrently ericsnowcurrently deleted the consolidate-threading-globals branch December 9, 2022 00:51
@vstinner
Copy link
Member

vstinner commented Dec 9, 2022

This change broke the wasm32-wasi 3.x buildbot: https://buildbot.python.org/all/#/builders/1046/builds/1051

@ericsnowcurrently
Copy link
Member Author

I'll look into it.

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.

4 participants