From the course: Complete Guide to Parallel and Concurrent Programming in Python
Unlock the full course today
Join today to access over 24,800 courses taught by industry experts.
Concurrent vs. parallel execution - Python Tutorial
From the course: Complete Guide to Parallel and Concurrent Programming in Python
Concurrent vs. parallel execution
- Just because a program is structured to have multiple threads or processes does not mean they'll necessarily execute in parallel. A concept that's closely related to parallel execution, but often gets confused with it, is concurrency. Concurrency refers to the ability of an algorithm or program to be broken into different parts that can be executed out of order or partially out of order without affecting the end result. Concurrency is about how a program is structured and the composition of independently executing processes. Consider this recipe to make a salad, which includes several steps that slicing and chopping vegetables. We can decompose those steps into a collection of concurrent tasks because the relative order in which we do them doesn't matter they're order independent. To keep things simple, let's just focus on two of those tasks for now. I'll chop onions. - And now slice cucumbers. This knife represents our computer's processor. We only have one knife, so this is a…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.
Contents
-
-
-
-
Thread vs. process4m 35s
-
(Locked)
Concurrent vs. parallel execution4m 53s
-
(Locked)
Global interpreter lock: Python demo4m 35s
-
(Locked)
Multiple threads: Python demo5m 52s
-
(Locked)
Multiple processes: Python demo5m 42s
-
(Locked)
Execution scheduling3m 38s
-
(Locked)
Execution scheduling: Python demo2m 42s
-
(Locked)
Thread lifecycle3m 35s
-
(Locked)
Thread lifecycle: Python demo5m 38s
-
(Locked)
Daemon thread2m 48s
-
(Locked)
Daemon thread: Python demo2m 29s
-
-
-
-
-
-
-
-
-
-
-