aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/Lib/asyncio/tasks.py
diff options
context:
space:
mode:
authorKumar Aditya <kumaraditya@python.org>2024-06-22 23:28:35 +0530
committerGitHub <noreply@github.com>2024-06-22 10:58:35 -0700
commit4717aaa1a72d1964f1531a7c613f37ce3d9056d9 (patch)
tree725e3b743d4ef707e89f5abe7804fce58fbd5036 /Lib/asyncio/tasks.py
parente21347549535b16f51a39986b78a2c2cd4ed09f4 (diff)
downloadcpython-4717aaa1a72d1964f1531a7c613f37ce3d9056d9.tar.gz
cpython-4717aaa1a72d1964f1531a7c613f37ce3d9056d9.zip
GH-107803: double linked list implementation for asyncio tasks (GH-107804)
* linked list * add tail optmiization to linked list * wip * wip * wip * more fixes * finally it works * add tests * remove weakreflist * add some comments * reduce code duplication in _asynciomodule.c * address some review comments * add invariants about the state of the linked list * add better explanation * clinic regen * reorder branches for better branch prediction * Update Modules/_asynciomodule.c * Apply suggestions from code review Co-authored-by: Itamar Oren <itamarost@gmail.com> * fix capturing of eager tasks * add comment to task finalization * fix tests and couple c implmentation to c task improved linked-list logic and more comments * fix test --------- Co-authored-by: Itamar Oren <itamarost@gmail.com>
Diffstat (limited to 'Lib/asyncio/tasks.py')
-rw-r--r--Lib/asyncio/tasks.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/Lib/asyncio/tasks.py b/Lib/asyncio/tasks.py
index dadcb5b5f36..cd869931e01 100644
--- a/Lib/asyncio/tasks.py
+++ b/Lib/asyncio/tasks.py
@@ -1097,14 +1097,14 @@ _py_unregister_eager_task = _unregister_eager_task
_py_enter_task = _enter_task
_py_leave_task = _leave_task
_py_swap_current_task = _swap_current_task
-
+_py_all_tasks = all_tasks
try:
from _asyncio import (_register_task, _register_eager_task,
_unregister_task, _unregister_eager_task,
_enter_task, _leave_task, _swap_current_task,
_scheduled_tasks, _eager_tasks, _current_tasks,
- current_task)
+ current_task, all_tasks)
except ImportError:
pass
else:
@@ -1116,3 +1116,4 @@ else:
_c_enter_task = _enter_task
_c_leave_task = _leave_task
_c_swap_current_task = _swap_current_task
+ _c_all_tasks = all_tasks