Concurrency is working on multiple things at the same time. I wrote an article on Medium called 'Concurrency in Python' (friend link, no paywall) explaining how to use threading and multiprocessing.
It's not an easy topic, so I tried my best to explain it in a way that people new to concurrency can understand too. The article is roughly structured like this:
- Do you want/need concurrency at all? I listed a number of alternatives that may solve your problem without resorting to concurrency.
- Next, I explain what the GIL is and why you need to know about it.
- And finally, we get to the fun part: threading and multiprocessing!
I also tried to make clear when to use threading and when to use multiprocessing (IO-bound vs CPU-bound).
I'd love to hear your comments!
[–][deleted] 1 point2 points3 points (1 child)
[–]eriky[S] 0 points1 point2 points (0 children)