From the course: Advanced Java: Threads and Concurrency

Unlock the full course today

Join today to access over 24,400 courses taught by industry experts.

Thread execution and the fork/join framework

Thread execution and the fork/join framework - Java Tutorial

From the course: Advanced Java: Threads and Concurrency

Thread execution and the fork/join framework

- [Instructor] Are the terms concurrent and parallel the same? Well, they might seem to be, but they're not really the same. Concurrent means that an application executes more than one task seemingly at the same time, but not really at the same time. Why do we say seemingly? Well, this is because in concurrency, if the computer has only one CPU, that CPU needs to do context switching or switching between different tasks during task execution to execute multiple tasks at the same time. So this isn't really about executing multiple tasks at the same time. On the other hand, parallel means that an application executes more than one task at the same time on hardware that has multiple CPUs or CPU cores. In this case, there's no need for context switching, so the tasks really are executing at the same time. Parallelism is a concept based on parallel execution, where tasks are split into smaller subtasks. These subtasks can be processed in parallel by multiple threads in multiple CPUs or CPU…

Contents