You are on page 1of 3

Concurrent & Parallel Execution

Er. Anshu Singh


Assistant Professor
Computer Science & Engineering Department
University of Lucknow
Lucknow

Branch: BCA
Semester: 3
Subject: Computer Architecture

Disclaimer: The e-content is exclusively meant for academic purposes and for
enhancing teaching and learning. Any other use for economic/commercial
purpose is strictly prohibited. The users of the content shall not distribute,
disseminate or share it with anyone else and its use is restricted to advancement
of individual knowledge. The information provided in this e-content is
developed from authentic references, to the best of my knowledge.
Concurrent & parallel execution

Concurrency means In no particular order, multiple tasks that start, run, and complete in
overlapping time periods.

Parallelism is when, for example, on a multi-core processor, several tasks OR several parts
of a unique task actually operate at the same time. Recall that Concurrency and parallelism
are NOT the same thing.
Concurrency
When we speak about a minimum of two tasks or more, concurrency is basically valid. If an
application is able to virtually perform two tasks at the same time, we call it a concurrent
application. Even though tasks run here appear to be simultaneous, but basically they Are not.
They take advantage of the operating system 's Processor time-slicing feature, where each
task runs part of its task and then goes to the waiting state. When the first task is in a waiting
state, the CPU is assigned to the second task to complete part of its task.
Operating system based on priority of tasks, thus, assigns CPU and other computing resources
e.g. memory; turn by turn to all tasks and give them chance to complete. To end user, it seems
that all tasks are running in parallel. This is called concurrency.
Time slice= 10 ns

Job1
Job2 CPU(single
Job3 processor)
Job4
Job5
Job1
Job2
Ready queue

Parallelism
Parallelism does not include the presence of two activities. Actually, by assigning one core to
each task or sub-task, it physically runs parts of tasks OR several tasks, using multi-core CPU
infrastructure at the same time.
Parallelism includes hardware, basically, with several processing units. You can get
concurrency in a single core CPU, but NOT parallelism.

Job1
Job2
Job3 P1
Job4
Job5
P2

P3

P4
Single CPU socket with 4 processor
Differences between concurrency vs. parallelism

• Concurrency is when two tasks can start, run, and complete in overlapping time
periods. Parallelism is when tasks literally run at the same time, e.g. on a multi-core
processor.
• Concurrency is the composition of independently executing processes, while
parallelism is the simultaneous execution of (possibly related) computations.
• Concurrency is about dealing with lots of things at once. Parallelism is about doing lots
of things at once.
• An application can be concurrent, but not parallel, which means that more than one
task is processed at the same time, but no two tasks are executed instantly at the same
time.
• An application can be parallel – but not concurrent, which means that it processes
multiple sub-tasks of a task in multi-core CPU at same time.
• An application can be neither parallel – nor concurrent, which means that it processes
all tasks one at a time, sequentially.
• An application can be both parallel – and concurrent, which means that it processes
multiple tasks concurrently in multi-core CPU at same time .

References:
1. John P Hayes “Computer Architecture and organization” McGraw Hill
2. Dezso Sima,Terence Fountain and Peter Kacsuk “ Advanced Computer
Architecture” Pearson Education
3. Kai Hwang “ Advanced Computer Architecture” TMH
4. Linda Null, Julia Lobur- The Essentials of Computer Organization and
Architecture, 2014, 4th Edition.

You might also like