Concurrent Programming in Python
Learn how to implement concurrent programming in python using multi-threading and aysncio.
Concurrency using threading
We can implement concurrency in python using the concepts of threads. A thread is a separate flow of execution. This means that your program will have two things happening at once. But for most Python 3
implementations, the different threads do not actually execute at the same time, they merely appear to. This is the reason we are using the term concurrency here instead of parallel processing. You can achieve that too using multiprocessing
, which comes with some extra overhead.
Let’s look at an example of concurrency using threads.
Get hands-on with 1200+ tech skills courses.