From the course: Complete Guide to Parallel and Concurrent Programming with C++
Unlock this course with a free trial
Join today to access over 24,800 courses taught by industry experts.
Concurrent versus parallel execution - C++ Tutorial
From the course: Complete Guide to Parallel and Concurrent Programming with C++
Concurrent versus 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 involve 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 I'll slice cucumbers. This knife represents our computer's processor. We only have one knife, so this…
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 versus process4m 36s
-
Thread versus process: C++ demo6m 11s
-
(Locked)
Concurrent versus parallel execution4m 54s
-
(Locked)
Execution scheduling3m 38s
-
(Locked)
Execution scheduling: C++ demo2m 27s
-
(Locked)
Thread life cycle3m 35s
-
(Locked)
Thread life cycle: C++ demo4m 29s
-
(Locked)
Detached thread2m 49s
-
(Locked)
Detached thread: C++ demo1m 52s
-
-
-
-
-
-
-
-
-
-
-