Skip to content

Store current task on the loop in asyncio  #128415

Closed
@kumaraditya303

Description

@kumaraditya303

Currently the current task of a loop in stored in a global dict mapping loops to their corresponding current tasks.

/* Dictionary containing tasks that are currently active in
all running event loops. {EventLoop: Task} */
PyObject *current_tasks;
/* WeakSet containing scheduled 3rd party tasks which don't

However this will perform poorly in free threading build as such I propose to store it in on the loop itself.

See https://discuss.python.org/t/store-current-task-on-the-loop/75926

Linked PRs

Metadata

Metadata

Assignees

No one assigned

    Projects

    Status

    Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions