Concurrency programming and Parallel programming

   |   1 minute read   |   Using 176 words

Reference to the explanation of concurrency and parallelism by the father of Erlang using a picture that even a 5-year-old can understand:


It may be more helpful to understand them from their opposite sides: The antonym of concurrency is sequential: concurrency vs sequential The antonym of parallelism is serial: parallelism vs serial

Other explanations of concurrency and parallelism are:

Concurrency: refers to the nature of the code that logically can be executed in parallel and has the potential to do so, but may not currently run in a physically parallel manner. Parallelism: refers to the physical running state.

Concurrency: the ability to do different things alternately; Parallelism: the ability to do different things at the same time.

Concurrency: performance of executing different code blocks alternately; Parallelism: performance of executing different code blocks simultaneously.

Concurrency and parallelism can both involve multiple threads. It depends on whether these threads can be executed by (multiple) CPUs at the same time. If so, it is parallelism. Concurrency is when multiple threads are executed by (one) CPU in a round-robin manner.

comments powered by Disqus