René's URL Explorer Experiment


Title: [3.15] gh-158195: Do not hold the type lock during stop-the-world (gh-159972) by nascheme · Pull Request #160987 · python/cpython · GitHub

Open Graph Title: [3.15] gh-158195: Do not hold the type lock during stop-the-world (gh-159972) by nascheme · Pull Request #160987 · python/cpython

X Title: [3.15] gh-158195: Do not hold the type lock during stop-the-world (gh-159972) by nascheme · Pull Request #160987 · python/cpython

Description: Fixes the free-threaded deadlock described in gh-158195 by removing type-lock pinning. The type lock and class dict lock can now be released normally while a thread waits to stop the world, rather than remaining pinned across that wait. This backport has a modification of GH-159972: avoid changing the default build behaviour. The following changes are now only for the free-threaded build: fresh __bases__ tuple copying type_new_copy_dict() and namespace-key normalization addition of the new exact-Unicode dictionary helpers This means that in the default build, you can still create a type with string-subclass keys. I'm not sure any code actually does that but it seems safer not to change that in a bugfix release.

Open Graph Description: Fixes the free-threaded deadlock described in gh-158195 by removing type-lock pinning. The type lock and class dict lock can now be released normally while a thread waits to stop the world, rather ...

X Description: Fixes the free-threaded deadlock described in gh-158195 by removing type-lock pinning. The type lock and class dict lock can now be released normally while a thread waits to stop the world, rather ...

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

X: @github

direct link

Domain: github.com

react-profiling0
react-import-mapreact,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322
route-pattern/:user_id/:repository/pull/:id/files(.:format)
route-controllerpull_requests
route-actionfiles
fetch-noncev2:c8787428-e1a3-dfc2-6698-5e479314cfde
current-catalog-service-hashae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b
request-idA574:14EB6E:19F059E:22119F7:6B02109D
html-safe-nonced3264e837e2fad67d12ebead2c2e4eea920016c4427af17aa1779ed7bd368e62
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBNTc0OjE0RUI2RToxOUYwNTlFOjIyMTE5Rjc6NkIwMjEwOUQiLCJ2aXNpdG9yX2lkIjoiNTU3MTk5MzU3NDYzNzE3OTAzOCIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9
visitor-hmac36c38e1ad961e395133d0c545f5e238e79646eb3c096e3488f83eb4db06b15e8
hovercard-subject-tagpull_request:5090525316
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///pull_requests/show/files
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/python/cpython/pull/160987/files
twitter:imagehttps://avatars.githubusercontent.com/u/690853?s=400&v=4
twitter:cardsummary_large_image
og:imagehttps://avatars.githubusercontent.com/u/690853?s=400&v=4
og:image:altFixes the free-threaded deadlock described in gh-158195 by removing type-lock pinning. The type lock and class dict lock can now be released normally while a thread waits to stop the world, rather ...
og:site_nameGitHub
og:typeobject
hostnamegithub.com
expected-hostnamegithub.com
None87e774ee7c6b3bee0490394e4d3e57ec9dbc956f74b87ea685dc8996c1676456
turbo-cache-controlno-preview
diff-viewunified
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 full-width
disable-turbotrue
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
release423dbb54c5e7bfecc838eb387c1435eb3d0e760d
ui-targetfull
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://github.com/python/cpython/pull/160987/files#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fpython%2Fcpython%2Fpull%2F160987%2Ffiles
GitHubRepository hosting, code review, and collaborationhttps://github.com/platform
CopilotAI coding agent for tasks, projects, and automated workhttps://github.com/features/copilot
ActionsCI/CD and automationhttps://github.com/features/actions
Code QualityQuality analysis, fixes, and enforcementhttps://github.com/features/code-quality
CodespacesCloud development environmentshttps://github.com/features/codespaces
Code SecurityVulnerability detection and remediationhttps://github.com/security/advanced-security/code-security
Secret ProtectionSecret scanning and leak preventionhttps://github.com/security/advanced-security/secret-protection
All Featureshttps://github.com/features
Documentationhttps://docs.github.com/en
Traininghttps://learn.github.com/skills
Certificationshttps://learn.github.com/credentials
Build with Copilothttps://github.com/features/ai
Customize Copilothttps://docs.github.com/en/copilot/how-tos/copilot-on-github/customize-copilot/customize-copilot-overview
Integrationshttps://github.com/marketplace
Trending reposhttps://github.com/trending
GitHub Sponsorshttps://github.com/open-source/sponsors
Developer articleshttps://github.com/resources/articles
ChangelogYour source for the latest features, improvements, and fixes across GitHub products, all in one place.https://github.blog/changelog/
Enterpriseshttps://github.com/enterprise
Teamhttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
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
See all industrieshttps://github.com/solutions/industry
Why GitHubhttps://github.com/why-github
Customer Storieshttps://github.com/customer-stories
Business insightshttps://github.com/solutions/executive-insights
Trust Centerhttps://github.com/trust-center
GitHub Advanced SecurityEnterprise-grade code securityhttps://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/enterprise/premium-support
Documentationhttps://docs.github.com/en
Resource centerhttps://github.com/resources
Bloghttps://github.blog/
Events & webinarshttps://github.com/resources/events
Community Forumhttps://github.com/orgs/community/discussions
Customer Storieshttps://github.com/customer-stories
Integrationshttps://github.com/marketplace
Customer supporthttps://help.github.com/
Traininghttps://learn.github.com/skills
GitHub Statushttps://www.githubstatus.com/
Abouthttps://github.com/about
Partnershttps://github.com/partners
Changeloghttps://github.blog/changelog/
GitHub UniverseThe event for developers, by developers — talks, workshops, and what’s next for GitHub.https://githubuniverse.com/
Pricinghttps://github.com/pricing
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fpython%2Fcpython%2Fpull%2F160987%2Ffiles
Sign uphttps://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fpull_requests%2Fshow%2Ffiles&source=header-repo&source_repo=python%2Fcpython
Reloadhttps://github.com/python/cpython/pull/160987/files
Reloadhttps://github.com/python/cpython/pull/160987/files
Reloadhttps://github.com/python/cpython/pull/160987/files
pythonhttps://github.com/python
cpythonhttps://github.com/python/cpython
Codehttps://github.com/python/cpython
Issues5k+ (5k+)https://github.com/python/cpython/issues
Pull requests2.4k (2.4k)https://github.com/python/cpython/pulls
Actionshttps://github.com/python/cpython/actions
Projectshttps://github.com/python/cpython/projects
Security and qualityhttps://github.com/python/cpython/security
Insightshttps://github.com/python/cpython/insights
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
naschemehttps://github.com/nascheme
python:3.15https://github.com/python/cpython/tree/3.15
nascheme:gh-158195-unpin-type-lock-3.15https://github.com/nascheme/cpython/tree/gh-158195-unpin-type-lock-3.15
Conversation 4 https://github.com/python/cpython/pull/160987
Commits 2 https://github.com/python/cpython/pull/160987/commits
Checks 82 https://github.com/python/cpython/pull/160987/checks
Files changed https://github.com/python/cpython/pull/160987/files
Please reload this pagehttps://github.com/python/cpython/pull/160987/files
[3.15] gh-158195: Do not hold the type lock during stop-the-world (gh-159972) https://github.com/python/cpython/pull/160987/files#top
Show all changes 2 commits https://github.com/python/cpython/pull/160987/files
15bc382 [3.15] gh-158195: Do not hold the type lock during stop-the-world nascheme Oct 30, 2026 https://github.com/python/cpython/pull/160987/commits/15bc3828984077e1700b3c5868a90dd715e52aa0
540c085 Revise backport of GH-159972. nascheme Oct 30, 2026 https://github.com/python/cpython/pull/160987/commits/540c08508a961ef66f686232692b26224b089500
Clear filters https://github.com/python/cpython/pull/160987/files
Please reload this pagehttps://github.com/python/cpython/pull/160987/files
Please reload this pagehttps://github.com/python/cpython/pull/160987/files
pycore_dict.h https://github.com/python/cpython/pull/160987/files#diff-47692c69ef97b2d7cf05ad8e0fa2024b575af96abf9bbc5486f71156ab67ede4
test_descr.py https://github.com/python/cpython/pull/160987/files#diff-6b813570d02ae3544e7e0233ae21d647f8e2dc47486495557e8d16c80460e85b
test_threading.py https://github.com/python/cpython/pull/160987/files#diff-be27d84769aae3c2f92edaf4dff2fc541f08e8d06450ab7e18cf01ad520a9f4e
test_type.py https://github.com/python/cpython/pull/160987/files#diff-3c426450792efb85491fe7c8888758e54cbef12bcc110ba6a1a460e400a3a901
2026-10-20-10-00-00.gh-issue-158195.UnpinTL.rst https://github.com/python/cpython/pull/160987/files#diff-4281cc6f55c2e9720cf075f37dbf0ba2337a8f957d7d3c5b79058548a63b193e
_testinternalcapi.c https://github.com/python/cpython/pull/160987/files#diff-687f4a736f1f6ad4b6cd4ff65c8e0113408304e8d65530dbd41b3f59a081a126
dictobject.c https://github.com/python/cpython/pull/160987/files#diff-b08a47ddc5bc20b2e99ac2e5aa199ca24a56b994e7bc64e918513356088c20ae
typeobject.c https://github.com/python/cpython/pull/160987/files#diff-1decebeef15f4e0b0ce106c665751ec55068d4d1d1825847925ad4f528b5b872
Include/internal/pycore_dict.hhttps://github.com/python/cpython/pull/160987/files#diff-47692c69ef97b2d7cf05ad8e0fa2024b575af96abf9bbc5486f71156ab67ede4
View file https://github.com/nascheme/cpython/blob/540c08508a961ef66f686232692b26224b089500/Include/internal/pycore_dict.h
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/python/cpython/pull/160987/{{ revealButtonHref }}
https://github.com/python/cpython/pull/160987/files#diff-47692c69ef97b2d7cf05ad8e0fa2024b575af96abf9bbc5486f71156ab67ede4
https://github.com/python/cpython/pull/160987/files#diff-47692c69ef97b2d7cf05ad8e0fa2024b575af96abf9bbc5486f71156ab67ede4
Lib/test/test_descr.pyhttps://github.com/python/cpython/pull/160987/files#diff-6b813570d02ae3544e7e0233ae21d647f8e2dc47486495557e8d16c80460e85b
View file https://github.com/nascheme/cpython/blob/540c08508a961ef66f686232692b26224b089500/Lib/test/test_descr.py
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/python/cpython/pull/160987/{{ revealButtonHref }}
https://github.com/python/cpython/pull/160987/files#diff-6b813570d02ae3544e7e0233ae21d647f8e2dc47486495557e8d16c80460e85b
https://github.com/python/cpython/pull/160987/files#diff-6b813570d02ae3544e7e0233ae21d647f8e2dc47486495557e8d16c80460e85b
https://github.com/python/cpython/pull/160987/files#diff-6b813570d02ae3544e7e0233ae21d647f8e2dc47486495557e8d16c80460e85b
https://github.com/python/cpython/pull/160987/files#diff-6b813570d02ae3544e7e0233ae21d647f8e2dc47486495557e8d16c80460e85b
Lib/test/test_free_threading/test_threading.pyhttps://github.com/python/cpython/pull/160987/files#diff-be27d84769aae3c2f92edaf4dff2fc541f08e8d06450ab7e18cf01ad520a9f4e
View file https://github.com/nascheme/cpython/blob/540c08508a961ef66f686232692b26224b089500/Lib/test/test_free_threading/test_threading.py
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/python/cpython/pull/160987/{{ revealButtonHref }}
https://github.com/python/cpython/pull/160987/files#diff-be27d84769aae3c2f92edaf4dff2fc541f08e8d06450ab7e18cf01ad520a9f4e
https://github.com/python/cpython/pull/160987/files#diff-be27d84769aae3c2f92edaf4dff2fc541f08e8d06450ab7e18cf01ad520a9f4e
Lib/test/test_free_threading/test_type.pyhttps://github.com/python/cpython/pull/160987/files#diff-3c426450792efb85491fe7c8888758e54cbef12bcc110ba6a1a460e400a3a901
View file https://github.com/nascheme/cpython/blob/540c08508a961ef66f686232692b26224b089500/Lib/test/test_free_threading/test_type.py
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/python/cpython/pull/160987/{{ revealButtonHref }}
https://github.com/python/cpython/pull/160987/files#diff-3c426450792efb85491fe7c8888758e54cbef12bcc110ba6a1a460e400a3a901
https://github.com/python/cpython/pull/160987/files#diff-3c426450792efb85491fe7c8888758e54cbef12bcc110ba6a1a460e400a3a901
https://github.com/python/cpython/pull/160987/files#diff-3c426450792efb85491fe7c8888758e54cbef12bcc110ba6a1a460e400a3a901
https://github.com/python/cpython/pull/160987/files#diff-3c426450792efb85491fe7c8888758e54cbef12bcc110ba6a1a460e400a3a901
https://github.com/python/cpython/pull/160987/files#diff-3c426450792efb85491fe7c8888758e54cbef12bcc110ba6a1a460e400a3a901
https://github.com/python/cpython/pull/160987/files#diff-3c426450792efb85491fe7c8888758e54cbef12bcc110ba6a1a460e400a3a901
Misc/NEWS.d/next/Core_and_Builtins/2026-10-20-10-00-00.gh-issue-158195.UnpinTL.rsthttps://github.com/python/cpython/pull/160987/files#diff-4281cc6f55c2e9720cf075f37dbf0ba2337a8f957d7d3c5b79058548a63b193e
View file https://github.com/nascheme/cpython/blob/540c08508a961ef66f686232692b26224b089500/Misc/NEWS.d/next/Core_and_Builtins/2026-10-20-10-00-00.gh-issue-158195.UnpinTL.rst
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/python/cpython/pull/160987/{{ revealButtonHref }}
Modules/_testinternalcapi.chttps://github.com/python/cpython/pull/160987/files#diff-687f4a736f1f6ad4b6cd4ff65c8e0113408304e8d65530dbd41b3f59a081a126
View file https://github.com/nascheme/cpython/blob/540c08508a961ef66f686232692b26224b089500/Modules/_testinternalcapi.c
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/python/cpython/pull/160987/{{ revealButtonHref }}
https://github.com/python/cpython/pull/160987/files#diff-687f4a736f1f6ad4b6cd4ff65c8e0113408304e8d65530dbd41b3f59a081a126
https://github.com/python/cpython/pull/160987/files#diff-687f4a736f1f6ad4b6cd4ff65c8e0113408304e8d65530dbd41b3f59a081a126
https://github.com/python/cpython/pull/160987/files#diff-687f4a736f1f6ad4b6cd4ff65c8e0113408304e8d65530dbd41b3f59a081a126
https://github.com/python/cpython/pull/160987/files#diff-687f4a736f1f6ad4b6cd4ff65c8e0113408304e8d65530dbd41b3f59a081a126
https://github.com/python/cpython/pull/160987/files#diff-687f4a736f1f6ad4b6cd4ff65c8e0113408304e8d65530dbd41b3f59a081a126
https://github.com/python/cpython/pull/160987/files#diff-687f4a736f1f6ad4b6cd4ff65c8e0113408304e8d65530dbd41b3f59a081a126
Please reload this pagehttps://github.com/python/cpython/pull/160987/files
Please reload this pagehttps://github.com/python/cpython/pull/160987/files
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.