Concurrency vs Parallelism
Explore the fundamental differences between concurrency and parallelism in C#. Understand how concurrent systems juggle tasks to improve responsiveness and how parallel systems run tasks simultaneously to maximize processing speed. This lesson uses relatable analogies to clarify these concepts, helping you distinguish their purposes and applications in software development.
We'll cover the following...
Concurrency vs Parallelism
Concurrency and Parallelism are often confused to refer to the ability of a system to run multiple distinct programs at the same time. Though the two terms are somewhat related they mean very different things. To clarify the concept, we'll borrow a juggler from a circus to use as an analogy. Consider the juggler to be a machine and the balls he juggles as processes.
Serial Execution
When programs are serially executed, they are scheduled one at a time on the CPU. Once a task gets completed, the next one gets a chance to run. Each task is run from beginning to end without interruption. The analogy for serial execution is a circus juggler ...