Title: Store and use the current task of asyncio on thread state for all threads · Issue #129898 · python/cpython · GitHub
Open Graph Title: Store and use the current task of asyncio on thread state for all threads · Issue #129898 · python/cpython
X Title: Store and use the current task of asyncio on thread state for all threads · Issue #129898 · python/cpython
Description: asyncio currently stores the current task in a global dict _current_tasks and on thread state. Storing it on dict in free-threading will cause significant contention under many threads and such I propose to remove it and always rely on t...
Open Graph Description: asyncio currently stores the current task in a global dict _current_tasks and on thread state. Storing it on dict in free-threading will cause significant contention under many threads and such I p...
X Description: asyncio currently stores the current task in a global dict _current_tasks and on thread state. Storing it on dict in free-threading will cause significant contention under many threads and such I p...
Opengraph URL: https://github.com/python/cpython/issues/129898
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Store and use the current task of asyncio on thread state for all threads","articleBody":"`asyncio` currently stores the current task in a global dict `_current_tasks` and on thread state. Storing it on dict in free-threading will cause significant contention under many threads and such I propose to remove it and always rely on the task stored on the thread state.\n\nThis has the added benefit that external introspection will always have the correct task and it will be guaranteed by this implementation while also being performant. \n\ncc @asvetlov @ambv @pablogsal \n\n\n\u003c!-- gh-linked-prs -->\n### Linked PRs\n* gh-129899\n\u003c!-- /gh-linked-prs -->\n","author":{"url":"https://github.com/kumaraditya303","@type":"Person","name":"kumaraditya303"},"datePublished":"2025-02-09T13:38:58Z","url":"https://github.com/python/cpython/issues/129898"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:f613c495-bbc8-1173-e51b-281ed5cfb456 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 9422:16AB79:4BE0BE3:603159F:6B025D05 |
| html-safe-nonce | e18d186dfed7763c4cf41cb866afa93e929f843ea797c949c6f44f0fefbd8764 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5NDIyOjE2QUI3OTo0QkUwQkUzOjYwMzE1OUY6NkIwMjVEMDUiLCJ2aXNpdG9yX2lkIjoiMTYxNjU4NjgzOTczNTU1NzM4MSIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | fc706f5a72b4c89f19220f019bd831c4223e06f1679e1026cc8ec7257940e5eb |
| hovercard-subject-tag | issue:2840682410 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/python/cpython/129898/issue_layout |
| twitter:image | https://opengraph.githubassets.com/118cafa65be420a14b9599d375bcbbb3032ab3b94b4cbc1353bab86943c3b728/python/cpython/issues/129898 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/118cafa65be420a14b9599d375bcbbb3032ab3b94b4cbc1353bab86943c3b728/python/cpython/issues/129898 |
| og:image:alt | asyncio currently stores the current task in a global dict _current_tasks and on thread state. Storing it on dict in free-threading will cause significant contention under many threads and such I p... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | kumaraditya303 |
| hostname | github.com |
| expected-hostname | github.com |
| None | 87e774ee7c6b3bee0490394e4d3e57ec9dbc956f74b87ea685dc8996c1676456 |
| turbo-cache-control | no-preview |
| go-import | github.com/python/cpython git https://github.com/python/cpython.git |
| octolytics-dimension-user_id | 1525981 |
| octolytics-dimension-user_login | python |
| octolytics-dimension-repository_id | 81598961 |
| octolytics-dimension-repository_nwo | python/cpython |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 81598961 |
| octolytics-dimension-repository_network_root_nwo | python/cpython |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 423dbb54c5e7bfecc838eb387c1435eb3d0e760d |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width