You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
asyncio module state should be locked with mutexes in free-threaded builds #121621
I think we also want to make enter_task, leave_task, and swap_current_task behave atomically. For example, enter_task makes two dict API calls that individually lock the dictionary, but the combined operation isn't atomic.
I can think of two strategies for this:
Try to replace multiple API calls with a single call. For example, I think enter_task may be able to use PyDict_SetDefaultRef and leave_task may be able to use _PyDict_DelItemIf with some modifications.
Use a critical section to lock the dict and use the "lock held" variants.
Activity
colesbury commentedon Jul 11, 2024
I think we also want to make
enter_task,leave_task, andswap_current_taskbehave atomically. For example,enter_taskmakes two dict API calls that individually lock the dictionary, but the combined operation isn't atomic.I can think of two strategies for this:
enter_taskmay be able to usePyDict_SetDefaultRefandleave_taskmay be able to use_PyDict_DelItemIfwith some modifications.gh-121621: Use PyMutex for writes to asyncio state (#121622)
[3.13] pythongh-121621: Use PyMutex for writes to asyncio state (pyth…
[3.13] gh-121621: Use PyMutex for writes to asyncio state (GH-121622) (…
gh-121621: Move asyncio running loop to thread state (GH-121695)
pythongh-121621: Move asyncio running loop to thread state (pythonGH-…
[3.13] gh-121621: Move asyncio running loop to thread state (GH-121695)…
pythongh-121621: Use PyMutex for writes to asyncio state (python#121622)
pythongh-121621: Move asyncio_running_loop to private struct
gh-121621: Move asyncio_running_loop to private struct (#121939)
pythongh-121621: Move asyncio_running_loop to private struct (pythonG…
[3.13] gh-121621: Move asyncio_running_loop to private struct (GH-121939
pythongh-121621: Disable asyncio freelist in free-threaded build
gh-121621: Disable asyncio freelist in free-threaded build (#122046)
[3.13] pythongh-121621: Disable asyncio freelist in free-threaded bui…
[3.13] gh-121621: Disable asyncio freelist in free-threaded build (GH…
Fidget-Spinner commentedon Jul 22, 2024
Fixed.
gh-121621: clear running loop early in asyncio (#128004)
pythongh-121621: clear running loop early in asyncio (python#128004)