CS439-CC-2-Parallel Distributed Systems
CS439-CC-2-Parallel Distributed Systems
• Amdahl's Law
if α is the fraction of running time a sequential
program spends on non-parallelizable segments of
the computation then
S = 1/ α
• Gustafson's Law
The scaled speed-up with N parallel processes
S(N) = N + α( 1 - N)
Concurrency
Improve performance
o Parallel applications partition workload & distribute it
to multiple threads running concurrently.
A deadlock situation on a resource can arise iff all of the above conditions hold
simultaneously in the system.
Monitor
A monitor provides special procedures to access the data in a critical
section.
Other Challenges
• Livelock condition
Two or more processes/threads continually change their state in
response to changes in the other processes; then none of the
processes can complete its execution.
• Priority inversion
Often concurrently running processes/threads are scheduled
based on their priorities.
Priority inversion means that a higher priority process/task is
indirectly preempted by a lower priority one.
• A collection of
Autonomous computers
• Access transparency
Local & remote resources are accessed using
identical operations
• Location transparency
Information objects are accessed without
knowing their location.
• Concurrency transparency
several processes run concurrently using shared
information objects without interference among
them.
• Replication transparency
Multiple instances of information objects increase
reliability without the knowledge of users or
applications.
Desirable properties of a distributed system
• Failure transparency
Concealment of faults.
• Migration transparency
Information objects in the system are moved
without affecting the operation performed on
them.
• Performance transparency
System can be reconfigured based on the load
and quality of service requirements.
• Scaling transparency
System & applications can scale without
changing the system structure and without
affecting the applications.
Processes, threads, events
• Dispatchable units of work:
Process is a program in execution
Thread is a light-weight process
• State of a process/thread
Information required to restart a suspended process/thread,
e.g. program counter and the current values of the registers.
• Event
A change of state of a process e.g. local or Communication
events
• Process group
A collection of cooperating processes
Processes cooperate & communicate to reach a common
goal
• Global state of a distributed system
Distributed systems consists several processes &
communication channels
Global state is the union of states of individual processes and
Messages and communication channels
1 2 5
e e 3
e
4
e e
a) All events in process p1 are local p 2
2 2 2 2 2
event
o p1 sends a message to p2 1
e
2 e
2
2 e
3
2
4
e
2
of communication events.
3 3 3 3
p 3
(c)
Global state of a process group
p
1
1, 0
0 ,1
p
2 1
e e 2
2
2
1 2
e e
(a) Lattice of
2, 0
1,1
0, 2
p
1 1
global states of 2
1
p 2
4 ,1
3, 2 2,3 1 2
e e 1 1
p
1
5 ,1 3, 3
p
4, 2 2, 4 2 1 2
e e 2 2
(b) 6 possible e e
1
1
2
1
sequences of 5, 2
4,3
3, 4
2,5 p
1
events leading to p
2 1 2
e 2 e 2
p 1
4,5 p
5, 4 2 1 2
e 2 e 2
5, 5
(a) time
6,5 (b)
Process Coordination - Communication protocols
)
Logical Clocks
1 2 3 4 5 12
p 1
m 1 m 2 m
5
1 2 6 7 8 9
p 2
m 3 m
4
1 2 3 10 11
p 3
)
Message delivery rules; causal delivery
• Before-or-after atomicity
Effect of multiple actions is as if these actions have
occurred one after another, in some order.
• A systematic approach to atomicity must
address several delicate questions:
How to guarantee that only one atomic action has
access to a shared resource at any given time?
How to return to the original state of the system
when an atomic action fails to complete?
• Consensus
Process of agreeing to one of several alternates
proposed by a number of agents.
• Consensus service
Set of n processes
Clients send requests, propose a value and wait
for a response
Goal is to get the set of processes to reach
consensus on a single proposed value.
Consensus protocols
a) Email service
Sender and receiver
communicate
asynchronously using
inboxes and outboxes
Mail demons run at each
site.
b) Event service
supports coordination in a
distributed environment
(a)
time time
HTTP Communication
request to proxy
(b) communicate HTTP client
Web request to server
through a proxy Browser
Proxy
TCP port 80