René's URL Explorer Experiment


Title: gh-59956: Clarify GILState-related Code by ericsnowcurrently · Pull Request #101161 · python/cpython · GitHub

Open Graph Title: gh-59956: Clarify GILState-related Code by ericsnowcurrently · Pull Request #101161 · python/cpython

X Title: gh-59956: Clarify GILState-related Code by ericsnowcurrently · Pull Request #101161 · python/cpython

Description: The objective of this change is to help make the GILState-related code easier to understand. This mostly involves moving code around and some semantically equivalent refactors. However, there are...

Open Graph Description: The objective of this change is to help make the GILState-related code easier to understand. This mostly involves moving code around and some semantically equivalent refactors. However, there are...

X Description: The objective of this change is to help make the GILState-related code easier to understand. This mostly involves moving code around and some semantically equivalent refactors. However, there are...

Opengraph URL: https://github.com/python/cpython/pull/101161

X: @github

direct link

Domain: github.com

route-pattern/_view_fragments/voltron/pull_requests/show/:user_id/:repository/:id/pull_request_layout(.:format)
route-controllervoltron_pull_requests_fragments
route-actionpull_request_layout
fetch-noncev2:4e2a4a5f-7bd4-646b-5e56-07a322f6d156
current-catalog-service-hashae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b
request-idCBD0:20E170:58FB2B:7B4921:696A2548
html-safe-nonceebcf2e18d75724c9f4380aa14e889e3b22d8c87330fa3de74b7852f8456b6ba5
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJDQkQwOjIwRTE3MDo1OEZCMkI6N0I0OTIxOjY5NkEyNTQ4IiwidmlzaXRvcl9pZCI6IjY4NzI5ODkxOTIwNTI5NDIxNTIiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ==
visitor-hmacd0fb31a90a229e7ba36354f067620b46989159fa73e45b536de3551f0c1ef127
hovercard-subject-tagpull_request:1210535347
github-keyboard-shortcutsrepository,pull-request-list,pull-request-conversation,pull-request-files-changed,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///voltron/pull_requests_fragments/pull_request_layout
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/_view_fragments/voltron/pull_requests/show/python/cpython/101161/pull_request_layout
twitter:imagehttps://opengraph.githubassets.com/4d9e8cbf6ba0b0e9f55803096e1e2ede0471a3233eca30a0b871c8a08dc9b6f7/python/cpython/pull/101161
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/4d9e8cbf6ba0b0e9f55803096e1e2ede0471a3233eca30a0b871c8a08dc9b6f7/python/cpython/pull/101161
og:image:altThe objective of this change is to help make the GILState-related code easier to understand. This mostly involves moving code around and some semantically equivalent refactors. However, there are...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernameericsnowcurrently
hostnamegithub.com
expected-hostnamegithub.com
Nonea1022f03e4f0d91ea173e4e5dac892c982e0588c62f1ce56121d755a320a3569
turbo-cache-controlno-preview
go-importgithub.com/python/cpython git https://github.com/python/cpython.git
octolytics-dimension-user_id1525981
octolytics-dimension-user_loginpython
octolytics-dimension-repository_id81598961
octolytics-dimension-repository_nwopython/cpython
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id81598961
octolytics-dimension-repository_network_root_nwopython/cpython
turbo-body-classeslogged-out env-production page-responsive
disable-turbofalse
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
releasef472b8e6c7b3fdd5d0354972a3f4c516289bf0be
ui-targetfull
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://github.com/python/cpython/pull/101161#start-of-content
https://github.com/
Sign in https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fpython%2Fcpython%2Fpull%2F101161
GitHub CopilotWrite better code with AIhttps://github.com/features/copilot
GitHub SparkBuild and deploy intelligent appshttps://github.com/features/spark
GitHub ModelsManage and compare promptshttps://github.com/features/models
MCP RegistryNewIntegrate external toolshttps://github.com/mcp
ActionsAutomate any workflowhttps://github.com/features/actions
CodespacesInstant dev environmentshttps://github.com/features/codespaces
IssuesPlan and track workhttps://github.com/features/issues
Code ReviewManage code changeshttps://github.com/features/code-review
GitHub Advanced SecurityFind and fix vulnerabilitieshttps://github.com/security/advanced-security
Code securitySecure your code as you buildhttps://github.com/security/advanced-security/code-security
Secret protectionStop leaks before they starthttps://github.com/security/advanced-security/secret-protection
Why GitHubhttps://github.com/why-github
Documentationhttps://docs.github.com
Bloghttps://github.blog
Changeloghttps://github.blog/changelog
Marketplacehttps://github.com/marketplace
View all featureshttps://github.com/features
Enterpriseshttps://github.com/enterprise
Small and medium teamshttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
App Modernizationhttps://github.com/solutions/use-case/app-modernization
DevSecOpshttps://github.com/solutions/use-case/devsecops
DevOpshttps://github.com/solutions/use-case/devops
CI/CDhttps://github.com/solutions/use-case/ci-cd
View all use caseshttps://github.com/solutions/use-case
Healthcarehttps://github.com/solutions/industry/healthcare
Financial serviceshttps://github.com/solutions/industry/financial-services
Manufacturinghttps://github.com/solutions/industry/manufacturing
Governmenthttps://github.com/solutions/industry/government
View all industrieshttps://github.com/solutions/industry
View all solutionshttps://github.com/solutions
AIhttps://github.com/resources/articles?topic=ai
Software Developmenthttps://github.com/resources/articles?topic=software-development
DevOpshttps://github.com/resources/articles?topic=devops
Securityhttps://github.com/resources/articles?topic=security
View all topicshttps://github.com/resources/articles
Customer storieshttps://github.com/customer-stories
Events & webinarshttps://github.com/resources/events
Ebooks & reportshttps://github.com/resources/whitepapers
Business insightshttps://github.com/solutions/executive-insights
GitHub Skillshttps://skills.github.com
Documentationhttps://docs.github.com
Customer supporthttps://support.github.com
Community forumhttps://github.com/orgs/community/discussions
Trust centerhttps://github.com/trust-center
Partnershttps://github.com/partners
GitHub SponsorsFund open source developershttps://github.com/sponsors
Security Labhttps://securitylab.github.com
Maintainer Communityhttps://maintainers.github.com
Acceleratorhttps://github.com/accelerator
Archive Programhttps://archiveprogram.github.com
Topicshttps://github.com/topics
Trendinghttps://github.com/trending
Collectionshttps://github.com/collections
Enterprise platformAI-powered developer platformhttps://github.com/enterprise
GitHub Advanced SecurityEnterprise-grade security featureshttps://github.com/security/advanced-security
Copilot for BusinessEnterprise-grade AI featureshttps://github.com/features/copilot/copilot-business
Premium SupportEnterprise-grade 24/7 supporthttps://github.com/premium-support
Pricinghttps://github.com/pricing
Search syntax tipshttps://docs.github.com/search-github/github-code-search/understanding-github-code-search-syntax
documentationhttps://docs.github.com/search-github/github-code-search/understanding-github-code-search-syntax
Sign in https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fpython%2Fcpython%2Fpull%2F101161
Sign up https://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fvoltron%2Fpull_requests_fragments%2Fpull_request_layout&source=header-repo&source_repo=python%2Fcpython
Reloadhttps://github.com/python/cpython/pull/101161
Reloadhttps://github.com/python/cpython/pull/101161
Reloadhttps://github.com/python/cpython/pull/101161
python https://github.com/python
cpythonhttps://github.com/python/cpython
Please reload this pagehttps://github.com/python/cpython/pull/101161
Notifications https://github.com/login?return_to=%2Fpython%2Fcpython
Fork 33.9k https://github.com/login?return_to=%2Fpython%2Fcpython
Star 71.1k https://github.com/login?return_to=%2Fpython%2Fcpython
Code https://github.com/python/cpython
Issues 5k+ https://github.com/python/cpython/issues
Pull requests 2.1k https://github.com/python/cpython/pulls
Actions https://github.com/python/cpython/actions
Projects 31 https://github.com/python/cpython/projects
Security Uh oh! There was an error while loading. Please reload this page. https://github.com/python/cpython/security
Please reload this pagehttps://github.com/python/cpython/pull/101161
Insights https://github.com/python/cpython/pulse
Code https://github.com/python/cpython
Issues https://github.com/python/cpython/issues
Pull requests https://github.com/python/cpython/pulls
Actions https://github.com/python/cpython/actions
Projects https://github.com/python/cpython/projects
Security https://github.com/python/cpython/security
Insights https://github.com/python/cpython/pulse
Sign up for GitHub https://github.com/signup?return_to=%2Fpython%2Fcpython%2Fissues%2Fnew%2Fchoose
terms of servicehttps://docs.github.com/terms
privacy statementhttps://docs.github.com/privacy
Sign inhttps://github.com/login?return_to=%2Fpython%2Fcpython%2Fissues%2Fnew%2Fchoose
Jump to bottomhttps://github.com/python/cpython/pull/101161#issue-comment-box
ericsnowcurrentlyhttps://github.com/ericsnowcurrently
python:mainhttps://github.com/python/cpython/tree/main
ericsnowcurrently:gilstate-cleanup-2https://github.com/ericsnowcurrently/cpython/tree/gilstate-cleanup-2
gh-59956: Clarify GILState-related Code https://github.com/python/cpython/pull/101161#top
ericsnowcurrentlyhttps://github.com/ericsnowcurrently
python:mainhttps://github.com/python/cpython/tree/main
ericsnowcurrently:gilstate-cleanup-2https://github.com/ericsnowcurrently/cpython/tree/gilstate-cleanup-2
Conversation 1 https://github.com/python/cpython/pull/101161
Commits 11 https://github.com/python/cpython/pull/101161/commits
Checks 0 https://github.com/python/cpython/pull/101161/checks
Files changed https://github.com/python/cpython/pull/101161/files
Please reload this pagehttps://github.com/python/cpython/pull/101161
https://github.co/hiddenchars
https://github.com/python/cpython/pull/{{ revealButtonHref }}
https://github.com/ericsnowcurrently
ericsnowcurrentlyhttps://github.com/ericsnowcurrently
Jan 19, 2023https://github.com/python/cpython/pull/101161#issue-1549701984
Please reload this pagehttps://github.com/python/cpython/pull/101161
6281edbhttps://github.com/python/cpython/commit/6281edb2c5d42150b413ae89df9d0e4b68eaf8f3
4af2ecbhttps://github.com/python/cpython/commit/4af2ecbe2e2881d003ef59645271850230bc8d75
7bdf5a4https://github.com/python/cpython/commit/7bdf5a41afee01fd20c26ef2237c8fe6d261c245
7bdf5a4https://github.com/python/cpython/commit/7bdf5a41afee01fd20c26ef2237c8fe6d261c245
[subinterpreters] Make the PyGILState API compatible with subinterpreters #59956https://github.com/python/cpython/issues/59956
Please reload this pagehttps://github.com/python/cpython/pull/101161
ericsnowcurrentlyhttps://github.com/ericsnowcurrently
January 19, 2023 08:38https://github.com/python/cpython/pull/101161#commits-pushed-c35aee5
https://github.com/ericsnowcurrently
Add some TODO comments.https://github.com/python/cpython/pull/101161/commits/c35aee5f81d04e7d5a73f41054da9e95bd0d55be
c35aee5https://github.com/python/cpython/pull/101161/commits/c35aee5f81d04e7d5a73f41054da9e95bd0d55be
https://github.com/ericsnowcurrently
Factor out "current_tss" helpers.https://github.com/python/cpython/pull/101161/commits/bb86c59af215f67c1e81b86872ae7f0701c1768a
bb86c59https://github.com/python/cpython/pull/101161/commits/bb86c59af215f67c1e81b86872ae7f0701c1768a
https://github.com/ericsnowcurrently
Inline the current_tss helpers.https://github.com/python/cpython/pull/101161/commits/5903b39ff79280a4196e5ef55576a05c772685b5
5903b39https://github.com/python/cpython/pull/101161/commits/5903b39ff79280a4196e5ef55576a05c772685b5
https://github.com/ericsnowcurrently
Factor out "current_fast" helpers.https://github.com/python/cpython/pull/101161/commits/a5eb3d86fc0e9153fe6693ff96ee84edf861c1e1
a5eb3d8https://github.com/python/cpython/pull/101161/commits/a5eb3d86fc0e9153fe6693ff96ee84edf861c1e1
https://github.com/ericsnowcurrently
Move tstate_current out of _PyRuntimeState.gilstate.https://github.com/python/cpython/pull/101161/commits/6281edb2c5d42150b413ae89df9d0e4b68eaf8f3
6281edbhttps://github.com/python/cpython/pull/101161/commits/6281edb2c5d42150b413ae89df9d0e4b68eaf8f3
https://github.com/ericsnowcurrently
Do not use _PyThreadState_GET() in pystate.c.https://github.com/python/cpython/pull/101161/commits/2f8aaecba9ff4a6cd975d730b9bfdc5dfe7b7b89
2f8aaechttps://github.com/python/cpython/pull/101161/commits/2f8aaecba9ff4a6cd975d730b9bfdc5dfe7b7b89
https://github.com/ericsnowcurrently
Move autoTSSkey out of _PyRuntimeState.gilstate.https://github.com/python/cpython/pull/101161/commits/4af2ecbe2e2881d003ef59645271850230bc8d75
4af2ecbhttps://github.com/python/cpython/pull/101161/commits/4af2ecbe2e2881d003ef59645271850230bc8d75
https://github.com/ericsnowcurrently
Initialize autoTSSkey earlier.https://github.com/python/cpython/pull/101161/commits/7bdf5a41afee01fd20c26ef2237c8fe6d261c245
7bdf5a4https://github.com/python/cpython/pull/101161/commits/7bdf5a41afee01fd20c26ef2237c8fe6d261c245
https://github.com/ericsnowcurrently
Factor out bind_tstate() and unbind_tstate().https://github.com/python/cpython/pull/101161/commits/4b952e03444b71708800a7590eb89739b5db021f
4b952e0https://github.com/python/cpython/pull/101161/commits/4b952e03444b71708800a7590eb89739b5db021f
https://github.com/ericsnowcurrently
PyThreadState_IsCurrent() -> holds_gil().https://github.com/python/cpython/pull/101161/commits/5e7283c786a38c9bfd2154a7a2d6c16b464ab5f5
5e7283chttps://github.com/python/cpython/pull/101161/commits/5e7283c786a38c9bfd2154a7a2d6c16b464ab5f5
https://github.com/ericsnowcurrently
ericsnowcurrentlyhttps://github.com/ericsnowcurrently
skip news https://github.com/python/cpython/issues?q=state%3Aopen%20label%3A%22skip%20news%22
Jan 19, 2023https://github.com/python/cpython/pull/101161#event-8314888849
https://github.com/bedevere-bot
bedevere-bothttps://github.com/bedevere-bot
awaiting core review https://github.com/python/cpython/issues?q=state%3Aopen%20label%3A%22awaiting%20core%20review%22
Jan 19, 2023https://github.com/python/cpython/pull/101161#event-8314889330
https://github.com/bedevere-bot
bedevere-bothttps://github.com/bedevere-bot
Jan 19, 2023 https://github.com/python/cpython/pull/101161#ref-issue-1198887438
[subinterpreters] Make the PyGILState API compatible with subinterpreters #59956 https://github.com/python/cpython/issues/59956
https://github.com/ericsnowcurrently
Do not set PyThreadState.thread_id to a negative value.https://github.com/python/cpython/pull/101161/commits/57bd92e359a00594fb8ba93fff414d30f26488a2
57bd92ehttps://github.com/python/cpython/pull/101161/commits/57bd92e359a00594fb8ba93fff414d30f26488a2
https://github.com/ericsnowcurrently
ericsnowcurrentlyhttps://github.com/ericsnowcurrently
🔨 test-with-buildbots https://github.com/python/cpython/issues?q=state%3Aopen%20label%3A%22%3Ahammer%3A%20test-with-buildbots%22
Jan 19, 2023https://github.com/python/cpython/pull/101161#event-8315570135
https://github.com/bedevere-bot
bedevere-bothttps://github.com/bedevere-bot
Jan 19, 2023https://github.com/python/cpython/pull/101161#issuecomment-1397510377
@ericsnowcurrentlyhttps://github.com/ericsnowcurrently
57bd92ehttps://github.com/python/cpython/commit/57bd92e359a00594fb8ba93fff414d30f26488a2
Please reload this pagehttps://github.com/python/cpython/pull/101161
https://github.com/bedevere-bot
bedevere-bothttps://github.com/bedevere-bot
🔨 test-with-buildbots https://github.com/python/cpython/issues?q=state%3Aopen%20label%3A%22%3Ahammer%3A%20test-with-buildbots%22
Jan 19, 2023https://github.com/python/cpython/pull/101161#event-8315570707
https://github.com/ericsnowcurrently
ericsnowcurrentlyhttps://github.com/ericsnowcurrently
6036c3ehttps://github.com/python/cpython/commit/6036c3e856f033bf13e929536e7bf127fdd921c9
Jan 19, 2023https://github.com/python/cpython/pull/101161#event-8316969611
https://github.com/bedevere-bot
bedevere-bothttps://github.com/bedevere-bot
awaiting core review https://github.com/python/cpython/issues?q=state%3Aopen%20label%3A%22awaiting%20core%20review%22
Jan 19, 2023https://github.com/python/cpython/pull/101161#event-8316969804
https://github.com/ericsnowcurrently
ericsnowcurrentlyhttps://github.com/ericsnowcurrently
January 19, 2023 23:04https://github.com/python/cpython/pull/101161#event-8316969922
https://github.com/ericsnowcurrently
ericsnowcurrentlyhttps://github.com/ericsnowcurrently
Jan 19, 2023 https://github.com/python/cpython/pull/101161#ref-pullrequest-1550105318
gh-59956: Fix Function Groupings in pystate.c #101172 https://github.com/python/cpython/pull/101172
ericsnowcurrentlyhttps://github.com/ericsnowcurrently
Jan 20, 2023 https://github.com/python/cpython/pull/101161#ref-commit-f30c940
https://github.com/ericsnowcurrently
gh-59956https://github.com/python/cpython/issues/59956
: Fix Function Groupings in pystate.c (https://github.com/python/cpython/commit/f30c94024f305d7d0ebb34fdd0f422442cfb0047
gh-101172https://github.com/python/cpython/pull/101172
)https://github.com/python/cpython/commit/f30c94024f305d7d0ebb34fdd0f422442cfb0047
f30c940https://github.com/python/cpython/commit/f30c94024f305d7d0ebb34fdd0f422442cfb0047
gh-101161https://github.com/python/cpython/pull/101161
#59956https://github.com/python/cpython/issues/59956
https://github.com/The-Compiler
The-Compilerhttps://github.com/The-Compiler
Jun 12, 2023 https://github.com/python/cpython/pull/101161#ref-issue-1752736136
3.12: "Python memory allocator called without holding the GIL" with PyMem_Free as Py_AtExit #105690 https://github.com/python/cpython/issues/105690
https://github.com/rgommers
rgommershttps://github.com/rgommers
Apr 20, 2025 https://github.com/python/cpython/pull/101161#ref-issue-3006569550
BUG: crash in python-dbg CI job due to calling Python C API without holding the GIL scipy/scipy#22860 https://github.com/scipy/scipy/issues/22860
Sign up for freehttps://github.com/join?source=comment-repo
Sign in to commenthttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fpython%2Fcpython%2Fpull%2F101161
skip news https://github.com/python/cpython/issues?q=state%3Aopen%20label%3A%22skip%20news%22
Please reload this pagehttps://github.com/python/cpython/pull/101161
https://github.com/ericsnowcurrently
https://github.com/bedevere-bot
https://github.com
Termshttps://docs.github.com/site-policy/github-terms/github-terms-of-service
Privacyhttps://docs.github.com/site-policy/privacy-policies/github-privacy-statement
Securityhttps://github.com/security
Statushttps://www.githubstatus.com/
Communityhttps://github.community/
Docshttps://docs.github.com/
Contacthttps://support.github.com?tags=dotcom-footer

Viewport: width=device-width


URLs of crawlers that visited me.