René's URL Explorer Experiment


Title: gh-129898: per-thread current task implementation in asyncio by kumaraditya303 · Pull Request #129899 · python/cpython · GitHub

Open Graph Title: gh-129898: per-thread current task implementation in asyncio by kumaraditya303 · Pull Request #129899 · python/cpython

X Title: gh-129898: per-thread current task implementation in asyncio by kumaraditya303 · Pull Request #129899 · python/cpython

Description: Issue: gh-129898 Store the current running task on the thread state, it makes it thread safe for the free-threading build and while improving performance as there is no lock contention, this effectively makes it lock free. When accessing the current task of the current running loop in current thread, no locking is required and can be acessed without locking. In the rare case of accessing current task of a loop running in a different thread, the stop the world pauses is used in free-threading builds to stop all other running threads and find the task for the specified loop. This also makes it easier for external introspection to find the current task, and now it will be always correct.

Open Graph Description: Issue: gh-129898 Store the current running task on the thread state, it makes it thread safe for the free-threading build and while improving performance as there is no lock contention, this effe...

X Description: Issue: gh-129898 Store the current running task on the thread state, it makes it thread safe for the free-threading build and while improving performance as there is no lock contention, this effe...

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

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:61c12906-5c1a-bf12-e370-4b12d3e7d32e
current-catalog-service-hashae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b
request-id8AD6:2A1EC8:184588D:1E77496:6B026E02
html-safe-nonce2eee4bc08d339b94b5f608adeafd73031bfb5963068d3ad8e22af2646f7f243d
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4QUQ2OjJBMUVDODoxODQ1ODhEOjFFNzc0OTY6NkIwMjZFMDIiLCJ2aXNpdG9yX2lkIjoiNzQ2NDI5MjQwNjQ2NTI5MzgyNiIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9
visitor-hmac1dcc51fa4f77b317cceaadbcf91a23f4ad92a4d356e6504a4e01c4a4c7ca3e62
hovercard-subject-tagpull_request:2324526039
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/129899/files
twitter:imagehttps://avatars.githubusercontent.com/u/59607654?s=400&v=4
twitter:cardsummary_large_image
og:imagehttps://avatars.githubusercontent.com/u/59607654?s=400&v=4
og:image:altIssue: gh-129898 Store the current running task on the thread state, it makes it thread safe for the free-threading build and while improving performance as there is no lock contention, this effe...
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/129899/files#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fpython%2Fcpython%2Fpull%2F129899%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%2F129899%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/129899/files
Reloadhttps://github.com/python/cpython/pull/129899/files
Reloadhttps://github.com/python/cpython/pull/129899/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
kumaraditya303https://github.com/kumaraditya303
python:mainhttps://github.com/python/cpython/tree/main
kumaraditya303:per-thread-cur-taskhttps://github.com/kumaraditya303/cpython/tree/per-thread-cur-task
Conversation 5 https://github.com/python/cpython/pull/129899
Commits 23 https://github.com/python/cpython/pull/129899/commits
Checks 0 https://github.com/python/cpython/pull/129899/checks
Files changed https://github.com/python/cpython/pull/129899/files
Please reload this pagehttps://github.com/python/cpython/pull/129899/files
gh-129898: per-thread current task implementation in asyncio https://github.com/python/cpython/pull/129899/files#top
Show all changes 23 commits https://github.com/python/cpython/pull/129899/files
0eb7df7 work kumaraditya303 Feb 7, 2025 https://github.com/python/cpython/pull/129899/commits/0eb7df790ba3991f11bef308172e38010b213287
ed16bbe work kumaraditya303 Feb 7, 2025 https://github.com/python/cpython/pull/129899/commits/ed16bbe517d493cd7f30c86223777f1c0d27dac2
c8048fb work kumaraditya303 Feb 7, 2025 https://github.com/python/cpython/pull/129899/commits/c8048fb7a2f37db959db7d30857a12aecbda6471
e132a59 work kumaraditya303 Feb 7, 2025 https://github.com/python/cpython/pull/129899/commits/e132a5920a96827cdc4b11b07036f351e1ef6fc7
986e16d work kumaraditya303 Feb 7, 2025 https://github.com/python/cpython/pull/129899/commits/986e16db54f2146e15299531b3d01772beea7f4d
19e3bfa fix all tests kumaraditya303 Feb 9, 2025 https://github.com/python/cpython/pull/129899/commits/19e3bfa5723c03275f4440ff49ac33520d5d5740
4e14182 fix tests kumaraditya303 Feb 9, 2025 https://github.com/python/cpython/pull/129899/commits/4e1418231c8e3f71731d2b6c12ec9fb1cfd80b04
40909d9 Merge branch 'main' of https://github.com/python/cpython into per-thr… kumaraditya303 Feb 9, 2025 https://github.com/python/cpython/pull/129899/commits/40909d9cd68dc612ef22bbb36db5bce3e03da679
0d7ace8 fix tests kumaraditya303 Feb 9, 2025 https://github.com/python/cpython/pull/129899/commits/0d7ace8edd47d93966ba3f0992e4152511d75a16
8aed0b8 finish it kumaraditya303 Feb 9, 2025 https://github.com/python/cpython/pull/129899/commits/8aed0b8ee6570630438c55d65f5a10cbd6b24bb3
36d66d9 fix test kumaraditya303 Feb 9, 2025 https://github.com/python/cpython/pull/129899/commits/36d66d9ff3a1dd0cc44a72684ff8050d5253147f
b09ec6b fixup kumaraditya303 Feb 9, 2025 https://github.com/python/cpython/pull/129899/commits/b09ec6b65003109ae17d1e526ea4c8f4ffec728d
9a7ea23 add comments kumaraditya303 Feb 10, 2025 https://github.com/python/cpython/pull/129899/commits/9a7ea23e9863b03824ed361ff8c1511bb736b15f
ba92dfb Merge branch 'main' into per-thread-cur-task kumaraditya303 Feb 10, 2025 https://github.com/python/cpython/pull/129899/commits/ba92dfba4d48af0f8cac52d020edc1c2e68501be
14ce5ef Merge branch 'main' into per-thread-cur-task kumaraditya303 Feb 15, 2025 https://github.com/python/cpython/pull/129899/commits/14ce5eff08f6eaab453a49b698b0516a6b46c4dc
3c274af reduce diff kumaraditya303 Feb 18, 2025 https://github.com/python/cpython/pull/129899/commits/3c274afbd23dd3c40b83c85cf01cd7d014a84dd8
8845b84 Merge branch 'main' of https://github.com/python/cpython into per-thr… kumaraditya303 Feb 18, 2025 https://github.com/python/cpython/pull/129899/commits/8845b8434d0eee5392c79816c0ba817ec21402fb
2316b85 simplify kumaraditya303 Feb 18, 2025 https://github.com/python/cpython/pull/129899/commits/2316b8568feb527514f7697c66a4d11ab969c29b
944c882 improve error msgs kumaraditya303 Feb 18, 2025 https://github.com/python/cpython/pull/129899/commits/944c8820a889065b584a2ba7c0d55587a6e66b8c
d5d7585 improve error msgs kumaraditya303 Feb 18, 2025 https://github.com/python/cpython/pull/129899/commits/d5d7585650231cc8c002e1e1813b9f69df5cca06
14b073a Merge branch 'main' of https://github.com/python/cpython into per-thr… kumaraditya303 Feb 18, 2025 https://github.com/python/cpython/pull/129899/commits/14b073a28338547ac270dbea37adc330ddf3a6a1
e01b381 improve error msg for swapping current task kumaraditya303 Feb 18, 2025 https://github.com/python/cpython/pull/129899/commits/e01b38138540f205a5fa0a5983e16d0473213c70
d2fab30 Update Modules/_asynciomodule.c kumaraditya303 Feb 19, 2025 https://github.com/python/cpython/pull/129899/commits/d2fab308fa85a56f4f1047a9bfe44e4563924faf
Clear filters https://github.com/python/cpython/pull/129899/files
Please reload this pagehttps://github.com/python/cpython/pull/129899/files
Please reload this pagehttps://github.com/python/cpython/pull/129899/files
tasks.py https://github.com/python/cpython/pull/129899/files#diff-429f4ed1e0f89ea2c92e2a8e8548ea8ae1a3d528979554fbfa4c38329e951529
_asynciomodule.c https://github.com/python/cpython/pull/129899/files#diff-6bd9e39980b88a721d902bcd915bbb3f24762f7f253430c45e52c42a2c5afd01
https://github.com/python/cpython/blob/main/.github/CODEOWNERS#L376
Lib/asyncio/tasks.pyhttps://github.com/python/cpython/pull/129899/files#diff-429f4ed1e0f89ea2c92e2a8e8548ea8ae1a3d528979554fbfa4c38329e951529
View file https://github.com/kumaraditya303/cpython/blob/d2fab308fa85a56f4f1047a9bfe44e4563924faf/Lib/asyncio/tasks.py
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/python/cpython/pull/129899/{{ revealButtonHref }}
https://github.com/python/cpython/pull/129899/files#diff-429f4ed1e0f89ea2c92e2a8e8548ea8ae1a3d528979554fbfa4c38329e951529
https://github.com/python/cpython/pull/129899/files#diff-429f4ed1e0f89ea2c92e2a8e8548ea8ae1a3d528979554fbfa4c38329e951529
https://github.com/python/cpython/blob/main/.github/CODEOWNERS#L378
Modules/_asynciomodule.chttps://github.com/python/cpython/pull/129899/files#diff-6bd9e39980b88a721d902bcd915bbb3f24762f7f253430c45e52c42a2c5afd01
View file https://github.com/kumaraditya303/cpython/blob/d2fab308fa85a56f4f1047a9bfe44e4563924faf/Modules/_asynciomodule.c
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/python/cpython/pull/129899/{{ revealButtonHref }}
https://github.com/python/cpython/pull/129899/files#diff-6bd9e39980b88a721d902bcd915bbb3f24762f7f253430c45e52c42a2c5afd01
https://github.com/python/cpython/pull/129899/files#diff-6bd9e39980b88a721d902bcd915bbb3f24762f7f253430c45e52c42a2c5afd01
https://github.com/python/cpython/pull/129899/files#diff-6bd9e39980b88a721d902bcd915bbb3f24762f7f253430c45e52c42a2c5afd01
https://github.com/python/cpython/pull/129899/files#diff-6bd9e39980b88a721d902bcd915bbb3f24762f7f253430c45e52c42a2c5afd01
https://github.com/python/cpython/pull/129899/files#diff-6bd9e39980b88a721d902bcd915bbb3f24762f7f253430c45e52c42a2c5afd01
Please reload this pagehttps://github.com/python/cpython/pull/129899/files
https://github.com/python/cpython/pull/129899/files#diff-6bd9e39980b88a721d902bcd915bbb3f24762f7f253430c45e52c42a2c5afd01
https://github.com/python/cpython/pull/129899/files#diff-6bd9e39980b88a721d902bcd915bbb3f24762f7f253430c45e52c42a2c5afd01
https://github.com/python/cpython/pull/129899/files#diff-6bd9e39980b88a721d902bcd915bbb3f24762f7f253430c45e52c42a2c5afd01
https://github.com/python/cpython/pull/129899/files#diff-6bd9e39980b88a721d902bcd915bbb3f24762f7f253430c45e52c42a2c5afd01
https://github.com/python/cpython/pull/129899/files#diff-6bd9e39980b88a721d902bcd915bbb3f24762f7f253430c45e52c42a2c5afd01
https://github.com/python/cpython/pull/129899/files#diff-6bd9e39980b88a721d902bcd915bbb3f24762f7f253430c45e52c42a2c5afd01
https://github.com/python/cpython/pull/129899/files#diff-6bd9e39980b88a721d902bcd915bbb3f24762f7f253430c45e52c42a2c5afd01
https://github.com/python/cpython/pull/129899/files#diff-6bd9e39980b88a721d902bcd915bbb3f24762f7f253430c45e52c42a2c5afd01
https://github.com/python/cpython/pull/129899/files#diff-6bd9e39980b88a721d902bcd915bbb3f24762f7f253430c45e52c42a2c5afd01
https://github.com/python/cpython/pull/129899/files#diff-6bd9e39980b88a721d902bcd915bbb3f24762f7f253430c45e52c42a2c5afd01
https://github.com/python/cpython/pull/129899/files#diff-6bd9e39980b88a721d902bcd915bbb3f24762f7f253430c45e52c42a2c5afd01
Please reload this pagehttps://github.com/python/cpython/pull/129899/files
https://github.com/python/cpython/pull/129899/files#diff-6bd9e39980b88a721d902bcd915bbb3f24762f7f253430c45e52c42a2c5afd01
https://github.com/python/cpython/pull/129899/files#diff-6bd9e39980b88a721d902bcd915bbb3f24762f7f253430c45e52c42a2c5afd01
https://github.com/python/cpython/pull/129899/files#diff-6bd9e39980b88a721d902bcd915bbb3f24762f7f253430c45e52c42a2c5afd01
https://github.com/python/cpython/pull/129899/files#diff-6bd9e39980b88a721d902bcd915bbb3f24762f7f253430c45e52c42a2c5afd01
https://github.com/python/cpython/pull/129899/files#diff-6bd9e39980b88a721d902bcd915bbb3f24762f7f253430c45e52c42a2c5afd01
https://github.com/python/cpython/pull/129899/files#diff-6bd9e39980b88a721d902bcd915bbb3f24762f7f253430c45e52c42a2c5afd01
https://github.com/python/cpython/pull/129899/files#diff-6bd9e39980b88a721d902bcd915bbb3f24762f7f253430c45e52c42a2c5afd01
https://github.com/python/cpython/pull/129899/files#diff-6bd9e39980b88a721d902bcd915bbb3f24762f7f253430c45e52c42a2c5afd01
https://github.com/python/cpython/pull/129899/files#diff-6bd9e39980b88a721d902bcd915bbb3f24762f7f253430c45e52c42a2c5afd01
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.