GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — gh-81057: Move Threading-Related Globals to _PyRuntimeState by ericsnowcurrently · Pull Request #100084 · python/cpython

Conversation

@ericsnowcurrently

@ericsnowcurrently ericsnowcurrently commented Dec 7, 2022 •
edited by bedevere-bot
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Member
  • Issue: [subinterpreters] Global C variables are a problem #81057

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@ericsnowcurrently ericsnowcurrently added the skip news label Dec 7, 2022
@ericsnowcurrently
ericsnowcurrently requested a review from a team as a code owner December 7, 2022 17:17
@netlify

netlify Bot commented Dec 7, 2022 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown

✅ 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.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@bedevere-bot bedevere-bot mentioned this pull request Dec 7, 2022
[subinterpreters] Global C variables are a problem #81057
Closed
@bedevere-bot bedevere-bot added the awaiting core review label Dec 7, 2022
@ericsnowcurrently
ericsnowcurrently removed the request for review from a team December 7, 2022 17:17
@ericsnowcurrently
ericsnowcurrently force-pushed the consolidate-threading-globals branch from f2399f9 to f05396b Compare December 8, 2022 01:34
@kumaraditya303

kumaraditya303 commented Dec 8, 2022

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

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@ericsnowcurrently

ericsnowcurrently commented Dec 8, 2022 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Member Author

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

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

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

bedevere-bot commented Dec 8, 2022

Copy link
Copy Markdown

🤖 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.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@bedevere-bot bedevere-bot removed the 🔨 test-with-buildbots Test PR w/ buildbots; report in status section label Dec 8, 2022
ericsnowcurrently added 8 commits December 8, 2022 17:18
@ericsnowcurrently
Add pycore_pythread.h.
8e7ea36
@ericsnowcurrently
Add PyThread__init_thread():lib_initialized.
9616123
@ericsnowcurrently
Move thread.c:initialized to _PyRuntimeState.
09fc557
@ericsnowcurrently
Move some macros into pycore_pythread.h.
649062a
@ericsnowcurrently
Move condattr_monotonic to _PyRuntimeState.
0a5106c
@ericsnowcurrently
Move init_condattr():ca to _PyRuntimeState.
9d7feb7
@ericsnowcurrently
Move py_tls_entries to _PyRuntimeState.
f606c66
@ericsnowcurrently
Clarify the macro.
3c22543
@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
@bedevere-bot bedevere-bot removed the awaiting core review label Dec 9, 2022
@ericsnowcurrently
ericsnowcurrently deleted the consolidate-threading-globals branch December 9, 2022 00:51
@vstinner

vstinner commented Dec 9, 2022

Copy link
Copy Markdown
Member

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

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@ericsnowcurrently

ericsnowcurrently commented Dec 9, 2022

Copy link
Copy Markdown
Member Author

I'll look into it.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@ericsnowcurrently ericsnowcurrently mentioned this pull request Dec 9, 2022
gh-81057: Fix the wasm32-wasi Buildbot #100139
Merged
ericsnowcurrently added a commit that referenced this pull request Dec 9, 2022
@ericsnowcurrently
gh-81057: Fix the wasm32-wasi Buildbot (gh-100139)
8d0bd93
The build was broken by gh-100084.

#81057
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

No reviews

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

skip news

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

4 participants

@ericsnowcurrently @kumaraditya303 @bedevere-bot @vstinner
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.