4 ms·
I often find myself overwhelmed thinking about concurrency/parallelism in Python: time.sleep, concurrent.futures, multiprocessing, threads, queues, asyncio, uvl
by pyjonista 7y ago
I often find myself overwhelmed thinking about concurrency/parallelism in Python: time.sleep, concurrent.futures, multiprocessing, threads, queues, asyncio, uvloop, tornado, twisted, events, coroutines, curio, trio, select, gevent, eventlet...
What is a good solution that the majority of us simple humans with limited time and resources should pursue? I want to write software that competes with similar solutions written in Go. Does that exist? Is there one solution that it's safe to adopt and generally recommended by the community? I used to think that asyncio was the solution to that but I was unable to fully understand its API. Please help!
- rickycook 7y agoi’d say that multiprocessing probably covers 90% of “do it in the background” tasks, and asyncio covers 90% of async networking tasks futures, uvloop, tornado, twisted, coros, gevent, etc are kinda just all related to, or do similar to asyncio threading is kinda not as useful as you might like in python because of the GIL (simplistically, assume that python can only do 1 thing at once regardless of having multiple threads available or not until you know why that’s not always the case)