René's URL Explorer Experiment


Title: Make the specializing interpreter thread-safe in `--disable-gil` builds · Issue #115999 · python/cpython · GitHub

Open Graph Title: Make the specializing interpreter thread-safe in `--disable-gil` builds · Issue #115999 · python/cpython

X Title: Make the specializing interpreter thread-safe in `--disable-gil` builds · Issue #115999 · python/cpython

Description: Feature or enhancement Proposal: In free-threaded builds, the specializing adaptive interpreter needs to be made thread-safe. We should start with a small PR to simply disable it in free-threaded builds, which will be correct but will in...

Open Graph Description: Feature or enhancement Proposal: In free-threaded builds, the specializing adaptive interpreter needs to be made thread-safe. We should start with a small PR to simply disable it in free-threaded b...

X Description: Feature or enhancement Proposal: In free-threaded builds, the specializing adaptive interpreter needs to be made thread-safe. We should start with a small PR to simply disable it in free-threaded b...

Opengraph URL: https://github.com/python/cpython/issues/115999

X: @github

direct link

Domain: github.com


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Make the specializing interpreter thread-safe in `--disable-gil` builds","articleBody":"# Feature or enhancement\r\n\r\n### Proposal:\r\n\r\nIn free-threaded builds, the specializing adaptive interpreter needs to be made thread-safe. We should start with a small PR to simply disable it in free-threaded builds, which will be correct but will incur a performance penalty. Then we can work out how to properly support specialization in a free-threaded build.\r\n\r\nThese two commits from Sam's nogil-3.12 branch can serve as inspiration:\r\n1. [specialize: make specialization thread-safe\r\n](https://github.com/colesbury/nogil-3.12/commit/7e7568672d)\r\n2. [specialize: optimize for single-threaded programs](https://github.com/colesbury/nogil-3.12/commit/90d34f0d18)\r\n\r\nThere are two primary concerns to balance while implementing this functionality on `main`:\r\n1. **Runtime overhead**: There should be no performance impact on normal builds, and minimal performance impact on single-threaded code running in free-threaded builds.\r\n2. **Reducing code duplication/divergence**: We should come up with a design that is minimally disruptive to ongoing work on the specializing interpreter. It should be easy for other devs to keep the free-threaded build working without having to know too much about it.\r\n\r\n### Has this already been discussed elsewhere?\r\n\r\nI have already discussed this feature proposal on Discourse\r\n\r\n### Links to previous discussion of this feature:\r\n\r\n- https://peps.python.org/pep-0703/\r\n- https://github.com/python/cpython/issues/108219\r\n\r\n### Specialization Families\r\n```[tasklist]\n- [x] BINARY_OP\n- [x] BINARY_SUBSCR - @corona10\n- [x] CALL - @mpage\n- [x] CALL_KW - @mpage\n- [x] COMPARE_OP - @Yhg1s\n- [x] CONTAINS_OP - @corona10\n- [x] FOR_ITER - @Yhg1s\n- [x] LOAD_ATTR - @mpage\n- [x] LOAD_CONST\n- [x] LOAD_GLOBAL - @mpage\n- [x] LOAD_SUPER_ATTR - @nascheme\n- [x] RESUME\n- [x] SEND - @nascheme\n- [x] STORE_ATTR - -@nascheme\n- [x] STORE_SUBSCR - @colesbury\n- [x] TO_BOOL - @corona10\n- [x] UNPACK_SEQUENCE - @Eclips4\n```\r\n\r\n\u003c!-- gh-linked-prs --\u003e\r\n### Linked PRs\r\n* gh-116013\r\n* gh-123926\r\n* gh-124953\r\n* gh-124997\r\n* gh-126410\r\n* gh-126414\r\n* gh-126440\r\n* gh-126450\r\n* gh-126498\r\n* gh-126515\r\n* gh-126600\r\n* gh-126607\r\n* gh-126616\r\n* gh-127030\r\n* gh-127123\r\n* gh-127128\r\n* gh-127167\r\n* gh-127169\r\n* gh-127227\r\n* gh-127426\r\n* gh-127514\r\n* gh-127711\r\n* gh-127713\r\n* gh-127737\r\n* gh-127838\r\n* gh-128164\r\n* gh-128166\r\n* gh-128637\r\n* gh-128798\n* gh-129365\n* gh-131285\n* gh-133824\n* gh-134286\n* gh-134348\n* gh-136249\n\u003c!-- /gh-linked-prs --\u003e\r\n","author":{"url":"https://github.com/swtaarrs","@type":"Person","name":"swtaarrs"},"datePublished":"2024-02-27T19:08:29.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":14},"url":"https://github.com/115999/cpython/issues/115999"}

route-pattern/_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format)
route-controllervoltron_issues_fragments
route-actionissue_layout
fetch-noncev2:5b723ba2-5e64-3459-d0f0-64421e84fca5
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-idB5B0:76A99:FCE072:15A0B1D:6A55C2DF
html-safe-nonce1d0fdc4b00e8ec6ed1d481f066774e470f408feda4bde7398fe4e541764d4ada
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCNUIwOjc2QTk5OkZDRTA3MjoxNUEwQjFEOjZBNTVDMkRGIiwidmlzaXRvcl9pZCI6IjQ2MzYxNTYyNDQxOTMwMzQ5NzUiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ==
visitor-hmace24bd38db620c1b338fac0c6850c13d946964c016b772296a5442746ec55e904
hovercard-subject-tagissue:2157407839
github-keyboard-shortcutsrepository,issues,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///voltron/issues_fragments/issue_layout
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/python/cpython/115999/issue_layout
twitter:imagehttps://opengraph.githubassets.com/d0fa09ecba74b3674118a4c409391a0d8bb5d46b28cf0227fdb55eada6771d02/python/cpython/issues/115999
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/d0fa09ecba74b3674118a4c409391a0d8bb5d46b28cf0227fdb55eada6771d02/python/cpython/issues/115999
og:image:altFeature or enhancement Proposal: In free-threaded builds, the specializing adaptive interpreter needs to be made thread-safe. We should start with a small PR to simply disable it in free-threaded b...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernameswtaarrs
hostnamegithub.com
expected-hostnamegithub.com
Noneb5665c84831ed9ac4fb79519c16c9c5580ba8092fb8bb6e3e72972ec7197348e
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
release8f8e1726192df8dce16872ceb503336c12e9ae78
ui-targetfull
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://github.com/python/cpython/issues/115999#start-of-content
https://github.com/
Sign in https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fpython%2Fcpython%2Fissues%2F115999
GitHub CopilotWrite better code with AIhttps://github.com/features/copilot
GitHub Copilot appDirect agents from issue to mergehttps://github.com/features/ai/github-app
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
View all resourceshttps://github.com/resources
GitHub SponsorsFund open source developershttps://github.com/open-source/sponsors
Security Labhttps://securitylab.github.com
Maintainer Communityhttps://maintainers.github.com
Acceleratorhttps://github.com/open-source/accelerator
GitHub Starshttps://stars.github.com
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/enterprise/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%2Fissues%2F115999
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%2Fissues_fragments%2Fissue_layout&source=header-repo&source_repo=python%2Fcpython
Reloadhttps://github.com/python/cpython/issues/115999
Reloadhttps://github.com/python/cpython/issues/115999
Reloadhttps://github.com/python/cpython/issues/115999
Please reload this pagehttps://github.com/python/cpython/issues/115999
python https://github.com/python
cpythonhttps://github.com/python/cpython
Please reload this pagehttps://github.com/python/cpython/issues/115999
Notifications https://github.com/login?return_to=%2Fpython%2Fcpython
Fork 35k https://github.com/login?return_to=%2Fpython%2Fcpython
Star 73.8k 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.3k https://github.com/python/cpython/pulls
Actions https://github.com/python/cpython/actions
Projects https://github.com/python/cpython/projects
Security and quality 0 https://github.com/python/cpython/security
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 and quality https://github.com/python/cpython/security
Insights https://github.com/python/cpython/pulse
Make the specializing interpreter thread-safe in --disable-gil buildshttps://github.com/python/cpython/issues/115999#top
https://github.com/mpage
interpreter-core(Objects, Python, Grammar, and Parser dirs)https://github.com/python/cpython/issues?q=state%3Aopen%20label%3A%22interpreter-core%22
topic-free-threadinghttps://github.com/python/cpython/issues?q=state%3Aopen%20label%3A%22topic-free-threading%22
type-featureA feature request or enhancementhttps://github.com/python/cpython/issues?q=state%3Aopen%20label%3A%22type-feature%22
https://github.com/swtaarrs
swtaarrshttps://github.com/swtaarrs
on Feb 27, 2024https://github.com/python/cpython/issues/115999#issue-2157407839
specialize: make specialization thread-safe https://github.com/colesbury/nogil-3.12/commit/7e7568672d
specialize: optimize for single-threaded programshttps://github.com/colesbury/nogil-3.12/commit/90d34f0d18
https://peps.python.org/pep-0703/https://peps.python.org/pep-0703/
PEP 703 -- Making the Global Interpreter Lock Optional in CPython #108219https://github.com/python/cpython/issues/108219
gh-115999: Disable the specializing adaptive interpreter in free-threaded builds #116013https://github.com/python/cpython/pull/116013
gh-115999: Implement thread-local bytecode and enable specialization for BINARY_OP #123926https://github.com/python/cpython/pull/123926
gh-115999: Refactor LOAD_GLOBAL specializations to avoid reloading {globals, builtins} keys #124953https://github.com/python/cpython/pull/124953
gh-115999: Stop the world when invalidating function versions #124997https://github.com/python/cpython/pull/124997
gh-115999: Add free-threaded specialization for COMPARE_OP #126410https://github.com/python/cpython/pull/126410
gh-115999: Introduce helpers for (un)specializing instructions #126414https://github.com/python/cpython/pull/126414
gh-115999: Fix gdb support for libpython.so after thread-local bytecode change #126440https://github.com/python/cpython/pull/126440
gh-115999: Add free-threaded specialization for CONTAINS_OP #126450https://github.com/python/cpython/pull/126450
gh-115999: Move specializer test from test_dis to test_opcache #126498https://github.com/python/cpython/pull/126498
gh-115999: Restore SET_OPCODE_OR_RETURN removed in GH-126414 #126515https://github.com/python/cpython/pull/126515
gh-115999: Add free-threaded specialization for UNPACK_SEQUENCE #126600https://github.com/python/cpython/pull/126600
gh-115999: Specialize LOAD_GLOBAL in free-threaded builds #126607https://github.com/python/cpython/pull/126607
gh-115999: Add free-threaded specialization for TO_BOOL #126616https://github.com/python/cpython/pull/126616
gh-115999: Don't take a reason in unspecialize #127030https://github.com/python/cpython/pull/127030
gh-115999: Enable specialization of CALL instructions in free-threaded builds #127123https://github.com/python/cpython/pull/127123
gh-115999: Specialize LOAD_SUPER_ATTR in free-threaded builds #127128https://github.com/python/cpython/pull/127128
gh-115999: Record success in specialize #127167https://github.com/python/cpython/pull/127167
gh-115999: Add free-threaded specialization for STORE_SUBSCR #127169https://github.com/python/cpython/pull/127169
gh-115999: Add partial free-thread specialization for BINARY_SUBSCR #127227https://github.com/python/cpython/pull/127227
gh-115999: Add free-threaded specialization for SEND. #127426https://github.com/python/cpython/pull/127426
gh-115999: Use light-weight lock for UNPACK_SEQUENCE_LIST #127514https://github.com/python/cpython/pull/127514
gh-115999: Specialize loading attributes from modules in free-threaded builds #127711https://github.com/python/cpython/pull/127711
gh-115999: Specialize CALL_KW in free-threaded builds #127713https://github.com/python/cpython/pull/127713
gh-115999: Enable BINARY_SUBSCR_GETITEM for free-threaded build #127737https://github.com/python/cpython/pull/127737
gh-115999: Specialize STORE_ATTR in free-threaded builds. #127838https://github.com/python/cpython/pull/127838
gh-115999: Specialize LOAD_ATTR for instance and class receivers in free-threaded builds #128164https://github.com/python/cpython/pull/128164
gh-115999: Update test_opcache to test with nested method #128166https://github.com/python/cpython/pull/128166
gh-115999: Make list and tuple iteration more thread-safe. #128637https://github.com/python/cpython/pull/128637
gh-115999: Add free-threaded specialization for FOR_ITER #128798https://github.com/python/cpython/pull/128798
gh-115999: Enable free-threaded specialization of LOAD_CONST #129365https://github.com/python/cpython/pull/129365
gh-115999: Note Python 3.14 free-threaded changes in What's New #131285https://github.com/python/cpython/pull/131285
[3.14] gh-115999: Note Python 3.14 free-threaded changes in What's New (gh-131285) #133824https://github.com/python/cpython/pull/133824
gh-115999: Add PyCodeObject.co_tlbc to the debug offsets #134286https://github.com/python/cpython/pull/134286
[3.14] gh-115999: Add PyCodeObject.co_tlbc to the debug offsets (GH-134286) #134348https://github.com/python/cpython/pull/134348
gh-115999: remove redundant check in free-threading from _STORE_ATTR_WITH_HINT #136249https://github.com/python/cpython/pull/136249
mpagehttps://github.com/mpage
interpreter-core(Objects, Python, Grammar, and Parser dirs)https://github.com/python/cpython/issues?q=state%3Aopen%20label%3A%22interpreter-core%22
topic-free-threadinghttps://github.com/python/cpython/issues?q=state%3Aopen%20label%3A%22topic-free-threading%22
type-featureA feature request or enhancementhttps://github.com/python/cpython/issues?q=state%3Aopen%20label%3A%22type-feature%22
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.