Bug report
fi_freelist isn't thread-safe (move to pycore_freelist.h and follow that pattern)
enter_task, leave_task, and swap_current_task aren't thread-safe due to shared state->current_tasks and borrowed references.
register_task and unregister_task aren't thread-safe due to shared state->asyncio_tasks linked list
_asyncio_all_tasks_impl isn't thread-safe due the the asyncio_tasks linked list.
For 2, 3, and 4, we can consider using critical sections to protect the accesses to state->current_tasks and state->asyncio_tasks.
Longer term, moving data to per-loop will probably help with multi-threaded scaling.
Linked PRs