[Python] Async co-routines as a replacement for threads to avoid shared DS mutation

Discussão em 'Python' iniciado por Stack, Setembro 5, 2025.

  1. Stack

    Stack Membro Participativo

    Does it make sense to use asyncio in python to avoid bugs caused by multithreading when a shared DS is mutated by several threads at the same time?

    Co-routines are cooperative, as opposed to preemptive threads, so there's no risk another co-routine will run before the current one finished, which is the case for threads.

    Or it's not a use case for co-routines b/c asyncio coroutines still run in one thread?

    Continue reading...

Compartilhe esta Página