CARVIEW |
Select Language
HTTP/2 200
date: Sun, 12 Oct 2025 06:43:25 GMT
content-type: text/html; charset=utf-8
vary: X-PJAX, X-PJAX-Container, Turbo-Visit, Turbo-Frame, X-Requested-With,Accept-Encoding, Accept, X-Requested-With
x-repository-download: git clone https://github.com/python/cpython.git
etag: W/"9f2a3e57c74fe53e374ac8de12754393"
cache-control: max-age=0, private, must-revalidate
strict-transport-security: max-age=31536000; includeSubdomains; preload
x-frame-options: deny
x-content-type-options: nosniff
x-xss-protection: 0
referrer-policy: no-referrer-when-downgrade
content-security-policy: default-src 'none'; base-uri 'self'; child-src github.githubassets.com github.com/assets-cdn/worker/ github.com/assets/ gist.github.com/assets-cdn/worker/; connect-src 'self' uploads.github.com www.githubstatus.com collector.github.com raw.githubusercontent.com api.github.com github-cloud.s3.amazonaws.com github-production-repository-file-5c1aeb.s3.amazonaws.com github-production-upload-manifest-file-7fdce7.s3.amazonaws.com github-production-user-asset-6210df.s3.amazonaws.com *.rel.tunnels.api.visualstudio.com wss://*.rel.tunnels.api.visualstudio.com github.githubassets.com objects-origin.githubusercontent.com copilot-proxy.githubusercontent.com proxy.individual.githubcopilot.com proxy.business.githubcopilot.com proxy.enterprise.githubcopilot.com *.actions.githubusercontent.com wss://*.actions.githubusercontent.com productionresultssa0.blob.core.windows.net/ productionresultssa1.blob.core.windows.net/ productionresultssa2.blob.core.windows.net/ productionresultssa3.blob.core.windows.net/ productionresultssa4.blob.core.windows.net/ productionresultssa5.blob.core.windows.net/ productionresultssa6.blob.core.windows.net/ productionresultssa7.blob.core.windows.net/ productionresultssa8.blob.core.windows.net/ productionresultssa9.blob.core.windows.net/ productionresultssa10.blob.core.windows.net/ productionresultssa11.blob.core.windows.net/ productionresultssa12.blob.core.windows.net/ productionresultssa13.blob.core.windows.net/ productionresultssa14.blob.core.windows.net/ productionresultssa15.blob.core.windows.net/ productionresultssa16.blob.core.windows.net/ productionresultssa17.blob.core.windows.net/ productionresultssa18.blob.core.windows.net/ productionresultssa19.blob.core.windows.net/ github-production-repository-image-32fea6.s3.amazonaws.com github-production-release-asset-2e65be.s3.amazonaws.com insights.github.com wss://alive.github.com wss://alive-staging.github.com api.githubcopilot.com api.individual.githubcopilot.com api.business.githubcopilot.com api.enterprise.githubcopilot.com; font-src github.githubassets.com; form-action 'self' github.com gist.github.com copilot-workspace.githubnext.com objects-origin.githubusercontent.com; frame-ancestors 'none'; frame-src viewscreen.githubusercontent.com notebooks.githubusercontent.com; img-src 'self' data: blob: github.githubassets.com media.githubusercontent.com camo.githubusercontent.com identicons.github.com avatars.githubusercontent.com private-avatars.githubusercontent.com github-cloud.s3.amazonaws.com objects.githubusercontent.com release-assets.githubusercontent.com secured-user-images.githubusercontent.com/ user-images.githubusercontent.com/ private-user-images.githubusercontent.com opengraph.githubassets.com marketplace-screenshots.githubusercontent.com/ copilotprodattachments.blob.core.windows.net/github-production-copilot-attachments/ github-production-user-asset-6210df.s3.amazonaws.com customer-stories-feed.github.com spotlights-feed.github.com objects-origin.githubusercontent.com *.githubusercontent.com; manifest-src 'self'; media-src github.com user-images.githubusercontent.com/ secured-user-images.githubusercontent.com/ private-user-images.githubusercontent.com github-production-user-asset-6210df.s3.amazonaws.com gist.github.com; script-src github.githubassets.com; style-src 'unsafe-inline' github.githubassets.com; upgrade-insecure-requests; worker-src github.githubassets.com github.com/assets-cdn/worker/ github.com/assets/ gist.github.com/assets-cdn/worker/
server: github.com
content-encoding: gzip
accept-ranges: bytes
set-cookie: _gh_sess=9XvGyT%2FmQ8WXYq1MLVHBfo3KWVBPK%2FiOXm1f7g77ntyu%2BdY1Kh9q983NR%2FGQuKr3I4eEVguscOVhiUudZHAtay%2B9Lr0VUCGh%2B8OJc7R%2Bkrzq0ZeBXQnGv%2FRzOzunQOey1qkoCD%2Bfe%2BhJKSVZjPpvlE9ktTWUh0QN1rzKDPhWMvVjOP7BUo8Zf3pv08wgBhFdcsQaoLHALmICCBWhQjqAwW%2BVK%2Ful29hTq2LOQbZXW9VUA9S%2BFdM4%2FfIZdPDGaCyMwlMiWLpnrc2ttxCwgkelQg%3D%3D--Ngo0s30TRwzwVNFk--%2BPtulL4eoKR%2BznmmMy3VJw%3D%3D; Path=/; HttpOnly; Secure; SameSite=Lax
set-cookie: _octo=GH1.1.1919999972.1760251404; Path=/; Domain=github.com; Expires=Mon, 12 Oct 2026 06:43:24 GMT; Secure; SameSite=Lax
set-cookie: logged_in=no; Path=/; Domain=github.com; Expires=Mon, 12 Oct 2026 06:43:24 GMT; HttpOnly; Secure; SameSite=Lax
x-github-request-id: 8BE0:27D4FB:235504:31E5FD:68EB4E0C
gh-129898: per-thread current task implementation in asyncio (#129899) · python/cpython@660f126 · GitHub
Skip to content
Navigation Menu
{{ message }}
-
-
Notifications
You must be signed in to change notification settings - Fork 33.1k
Commit 660f126
authored
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.
1 parent fb17f41 commit 660f126Copy full SHA for 660f126
File tree
Expand file treeCollapse file tree
2 files changed
+72
-158
lines changedFilter options
- Lib/asyncio
- Modules
Expand file treeCollapse file tree
2 files changed
+72
-158
lines changedCollapse file: Lib/asyncio/tasks.py
+1-1Lines changed: 1 addition & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
1110 | 1110 |
| |
1111 | 1111 |
| |
1112 | 1112 |
| |
1113 |
| - | |
| 1113 | + | |
1114 | 1114 |
| |
1115 | 1115 |
| |
1116 | 1116 |
| |
|
Collapse file: Modules/_asynciomodule.c
+71-157Lines changed: 71 additions & 157 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
139 | 139 |
| |
140 | 140 |
| |
141 | 141 |
| |
142 |
| - | |
143 |
| - | |
144 |
| - | |
145 |
| - | |
146 | 142 |
| |
147 | 143 |
| |
148 | 144 |
| |
| |||
2061 | 2057 |
| |
2062 | 2058 |
| |
2063 | 2059 |
| |
2064 |
| - | |
2065 |
| - | |
2066 | 2060 |
| |
2067 | 2061 |
| |
2068 | 2062 |
| |
| |||
2235 | 2229 |
| |
2236 | 2230 |
| |
2237 | 2231 |
| |
2238 |
| - | |
| 2232 | + | |
2239 | 2233 |
| |
2240 |
| - | |
2241 |
| - | |
2242 |
| - | |
| 2234 | + | |
| 2235 | + | |
| 2236 | + | |
| 2237 | + | |
2243 | 2238 |
| |
2244 | 2239 |
| |
2245 |
| - | |
| 2240 | + | |
| 2241 | + | |
2246 | 2242 |
| |
2247 | 2243 |
| |
2248 | 2244 |
| |
2249 | 2245 |
| |
2250 |
| - | |
2251 |
| - | |
| 2246 | + | |
2252 | 2247 |
| |
2253 | 2248 |
| |
2254 | 2249 |
| |
2255 |
| - | |
2256 |
| - | |
2257 |
| - | |
| 2250 | + | |
2258 | 2251 |
| |
2259 | 2252 |
| |
2260 | 2253 |
| |
2261 | 2254 |
| |
2262 |
| - | |
| 2255 | + | |
2263 | 2256 |
| |
2264 |
| - | |
2265 |
| - | |
2266 |
| - | |
2267 |
| - | |
2268 |
| - | |
2269 |
| - | |
2270 |
| - | |
2271 |
| - | |
2272 |
| - | |
2273 |
| - | |
2274 |
| - | |
2275 |
| - | |
2276 |
| - | |
2277 |
| - | |
2278 |
| - | |
| 2257 | + | |
2279 | 2258 |
| |
2280 |
| - | |
2281 |
| - | |
2282 |
| - | |
2283 |
| - | |
2284 |
| - | |
2285 |
| - | |
2286 |
| - | |
2287 |
| - | |
| 2259 | + | |
| 2260 | + | |
| 2261 | + | |
2288 | 2262 |
| |
2289 |
| - | |
2290 |
| - | |
2291 |
| - | |
2292 | 2263 |
| |
2293 |
| - | |
2294 |
| - | |
2295 |
| - | |
2296 |
| - | |
2297 |
| - | |
2298 |
| - | |
2299 |
| - | |
2300 |
| - | |
2301 |
| - | |
2302 |
| - | |
2303 |
| - | |
2304 |
| - | |
2305 |
| - | |
2306 |
| - | |
| 2264 | + | |
| 2265 | + | |
| 2266 | + | |
| 2267 | + | |
| 2268 | + | |
| 2269 | + | |
| 2270 | + | |
2307 | 2271 |
| |
2308 |
| - | |
| 2272 | + | |
| 2273 | + | |
2309 | 2274 |
| |
2310 | 2275 |
| |
2311 | 2276 |
| |
2312 |
| - | |
| 2277 | + | |
2313 | 2278 |
| |
2314 |
| - | |
2315 |
| - | |
2316 |
| - | |
2317 |
| - | |
2318 |
| - | |
2319 |
| - | |
2320 |
| - | |
2321 |
| - | |
2322 |
| - | |
2323 |
| - | |
2324 |
| - | |
2325 |
| - | |
| 2279 | + | |
2326 | 2280 |
| |
2327 |
| - | |
2328 |
| - | |
| 2281 | + | |
| 2282 | + | |
2329 | 2283 |
| |
2330 | 2284 |
| |
2331 | 2285 |
| |
2332 |
| - | |
2333 |
| - | |
2334 |
| - | |
2335 |
| - | |
2336 |
| - | |
2337 |
| - | |
2338 |
| - | |
2339 |
| - | |
2340 |
| - | |
2341 |
| - | |
2342 |
| - | |
2343 |
| - | |
2344 |
| - | |
2345 |
| - | |
2346 |
| - | |
2347 |
| - | |
2348 |
| - | |
2349 |
| - | |
2350 |
| - | |
2351 |
| - | |
2352 |
| - | |
2353 |
| - | |
2354 |
| - | |
2355 |
| - | |
2356 |
| - | |
2357 |
| - | |
2358 |
| - | |
2359 |
| - | |
2360 |
| - | |
2361 |
| - | |
2362 |
| - | |
2363 |
| - | |
2364 |
| - | |
2365 |
| - | |
2366 |
| - | |
2367 |
| - | |
2368 |
| - | |
2369 |
| - | |
2370 |
| - | |
2371 |
| - | |
2372 |
| - | |
2373 |
| - | |
2374 |
| - | |
2375 |
| - | |
2376 |
| - | |
2377 |
| - | |
2378 |
| - | |
| 2286 | + | |
| 2287 | + | |
| 2288 | + | |
2379 | 2289 |
| |
| 2290 | + | |
| 2291 | + | |
2380 | 2292 |
| |
2381 |
| - | |
2382 |
| - | |
2383 |
| - | |
2384 |
| - | |
2385 |
| - | |
2386 |
| - | |
2387 |
| - | |
2388 |
| - | |
2389 |
| - | |
| 2293 | + | |
| 2294 | + | |
2390 | 2295 |
| |
| 2296 | + | |
2391 | 2297 |
| |
2392 | 2298 |
| |
2393 | 2299 |
| |
| |||
3539 | 3445 |
| |
3540 | 3446 |
| |
3541 | 3447 |
| |
3542 |
| - | |
| 3448 | + | |
3543 | 3449 |
| |
3544 | 3450 |
| |
3545 | 3451 |
| |
3546 | 3452 |
| |
3547 | 3453 |
| |
3548 | 3454 |
| |
3549 | 3455 |
| |
3550 |
| - | |
| 3456 | + | |
3551 | 3457 |
| |
3552 | 3458 |
| |
3553 | 3459 |
| |
3554 | 3460 |
| |
3555 |
| - | |
| 3461 | + | |
3556 | 3462 |
| |
3557 | 3463 |
| |
3558 | 3464 |
| |
| |||
3566 | 3472 |
| |
3567 | 3473 |
| |
3568 | 3474 |
| |
3569 |
| - | |
| 3475 | + | |
3570 | 3476 |
| |
3571 | 3477 |
| |
3572 | 3478 |
| |
| |||
3595 | 3501 |
| |
3596 | 3502 |
| |
3597 | 3503 |
| |
3598 |
| - | |
| 3504 | + | |
3599 | 3505 |
| |
3600 | 3506 |
| |
3601 | 3507 |
| |
| |||
3907 | 3813 |
| |
3908 | 3814 |
| |
3909 | 3815 |
| |
3910 |
| - | |
3911 |
| - | |
| 3816 | + | |
3912 | 3817 |
| |
3913 | 3818 |
| |
3914 | 3819 |
| |
| |||
3932 | 3837 |
| |
3933 | 3838 |
| |
3934 | 3839 |
| |
3935 |
| - | |
3936 |
| - | |
| 3840 | + | |
3937 | 3841 |
| |
3938 | 3842 |
| |
3939 | 3843 |
| |
| |||
3957 | 3861 |
| |
3958 | 3862 |
| |
3959 | 3863 |
| |
3960 |
| - | |
| 3864 | + | |
3961 | 3865 |
| |
3962 | 3866 |
| |
3963 | 3867 |
| |
| |||
3974 | 3878 |
| |
3975 | 3879 |
| |
3976 | 3880 |
| |
3977 |
| - | |
3978 |
| - | |
3979 |
| - | |
3980 | 3881 |
| |
3981 | 3882 |
| |
3982 | 3883 |
| |
| |||
3986 | 3887 |
| |
3987 | 3888 |
| |
3988 | 3889 |
| |
3989 |
| - | |
3990 |
| - | |
3991 |
| - | |
| 3890 | + | |
| 3891 | + | |
| 3892 | + | |
| 3893 | + | |
| 3894 | + | |
| 3895 | + | |
| 3896 | + | |
| 3897 | + | |
| 3898 | + | |
3992 | 3899 |
| |
3993 | 3900 |
| |
| 3901 | + | |
| 3902 | + | |
| 3903 | + | |
| 3904 | + | |
| 3905 | + | |
| 3906 | + | |
| 3907 | + | |
| 3908 | + | |
| 3909 | + | |
| 3910 | + | |
| 3911 | + | |
| 3912 | + | |
| 3913 | + | |
| 3914 | + | |
| 3915 | + | |
| 3916 | + | |
| 3917 | + | |
| 3918 | + | |
| 3919 | + | |
3994 | 3920 |
| |
3995 | 3921 |
| |
3996 | 3922 |
| |
| |||
4258 | 4184 |
| |
4259 | 4185 |
| |
4260 | 4186 |
| |
4261 |
| - | |
4262 | 4187 |
| |
4263 | 4188 |
| |
4264 | 4189 |
| |
| |||
4289 | 4214 |
| |
4290 | 4215 |
| |
4291 | 4216 |
| |
4292 |
| - | |
4293 | 4217 |
| |
4294 | 4218 |
| |
4295 | 4219 |
| |
| |||
4319 | 4243 |
| |
4320 | 4244 |
| |
4321 | 4245 |
| |
4322 |
| - | |
4323 |
| - | |
4324 |
| - | |
4325 |
| - | |
4326 |
| - | |
4327 | 4246 |
| |
4328 | 4247 |
| |
4329 | 4248 |
| |
| |||
4456 | 4375 |
| |
4457 | 4376 |
| |
4458 | 4377 |
| |
4459 |
| - | |
4460 |
| - | |
4461 |
| - | |
4462 |
| - | |
4463 |
| - | |
4464 | 4378 |
| |
4465 | 4379 |
| |
4466 | 4380 |
| |
|
You can’t perform that action at this time.
0 commit comments