Skip to content

[3.14] gh-140414: add fastpath for current running loop in asyncio.all_tasks (GH-140542)#144494

Merged
kumaraditya303 merged 2 commits intopython:3.14from
miss-islington:backport-95e5d59-3.14
Feb 6, 2026
Merged

[3.14] gh-140414: add fastpath for current running loop in asyncio.all_tasks (GH-140542)#144494
kumaraditya303 merged 2 commits intopython:3.14from
miss-islington:backport-95e5d59-3.14

Conversation

@miss-islington
Copy link
Contributor

@miss-islington miss-islington commented Feb 5, 2026

Optimize asyncio.all_tasks() for the common case where the event loop is running in the current thread by avoiding stop-the-world pauses and locking.

This optimization is already present for asyncio.current_task() so we do the same for asyncio.all_tasks().
(cherry picked from commit 95e5d59)

Co-authored-by: Kumar Aditya kumaraditya@python.org

…l_tasks` (pythonGH-140542)

Optimize `asyncio.all_tasks()` for the common case where the event loop is running in the current thread by avoiding stop-the-world pauses and locking.

This optimization is already present for `asyncio.current_task()` so we do the same for `asyncio.all_tasks()`.
(cherry picked from commit 95e5d59)

Co-authored-by: Kumar Aditya <kumaraditya@python.org>
@kumaraditya303 kumaraditya303 added the 🔨 test-with-buildbots Test PR w/ buildbots; report in status section label Feb 5, 2026
@bedevere-bot
Copy link

🤖 New build scheduled with the buildbot fleet by @kumaraditya303 for commit d5b4023 🤖

Results will be shown at:

https://buildbot.python.org/all/#/grid?branch=refs%2Fpull%2F144494%2Fmerge

If you want to schedule another build, you need to add the 🔨 test-with-buildbots label again.

@kumaraditya303 kumaraditya303 merged commit f4239df into python:3.14 Feb 6, 2026
123 of 124 checks passed
@miss-islington miss-islington deleted the backport-95e5d59-3.14 branch February 6, 2026 03:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants