Remix.run Logo
hrmtst93837 3 hours ago

I think the core mistake is conflating async with threading and with the GIL, which causes people to treat asyncio like a magic GIL remover. For reference asyncio landed in CPython with Python 3.4 in March 2014, while threads and the GIL predate that, so Python could do concurrent IO long before 2023. In my experience asyncio is cooperative IO concurrency, so you must yield with await or explicitly offload blocking CPU work to concurrent.futures.ProcessPoolExecutor or run_in_executor, and you protect shared state with asyncio.Queue or an asyncio.Lock rather than assuming tasks are isolated. I've found the most practical pattern is message passing for state and keeping CPU heavy work in a process pool, because chasing a blocked event loop in production is a miserable way to learn concurrency.