Concurrency vs Parallel
Concurrency
|
Parallelism
|
There are multiple things in progress
|
Concurrent/Multiple things are processing at the
same time.
|
E.g: Juggler juggling many balls, juggler is
throwing one ball per hand at a time.
|
E.g: Multiple jugglers juggles multiple balls
simultaneously
|
Multiple execution flow with a potential for a
shared resource.
E.g. Two threads comparing for a single IO port
|
Splitting a problem into multiple chunks.
E.g. Parsing a big file by splitting and
processing the splits
|
Two queues accessing one ATM machine
|
Two queues accessing two ATM machines.
|
Multiple tasks can be performed in overlapping
the time periods with the shared resources.
|
Task is divided into multiple sub-tasks, which
can be run independently.
|
E.g. Multi tasking on a single-core machine
|
Running the tasks at the same time on multi-core
machine
|
Context switching happens
|
No context switching
|
Shared resources will exists
|
No shared resources
|
Composition of independently executing processes
|
Simultaneous execution
|
Interruptability exists
|
Independentability exists
|
You should rename this to SparkScalaNotes...rather SparkScalaMyNotes
ReplyDelete