From the course: Complete Guide to Parallel and Concurrent Programming with Java
Unlock this course with a free trial
Join today to access over 24,800 courses taught by industry experts.
Concurrent vs. parallel execution - Java Tutorial
From the course: Complete Guide to Parallel and Concurrent Programming with Java
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 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 vs. process4m 36s
-
(Locked)
Thread vs. process: Java demo6m 48s
-
(Locked)
Concurrent vs. parallel execution4m 54s
-
(Locked)
Execution scheduling3m 38s
-
(Locked)
Execution scheduling: Java1m 57s
-
(Locked)
Thread lifecycle3m 35s
-
(Locked)
Thread lifecycle: Java demo4m 55s
-
(Locked)
Thread attributes: Java demo2m 22s
-
(Locked)
Runnable vs. thread: Java demo3m 53s
-
(Locked)
Daemon thread2m 48s
-
(Locked)
Daemon thread: Java demo2m 21s
-
-
-
-
-
-
-
-
-
-
-