CS439 CC 2 Parallel Distributed Systems[1]
CS439 CC 2 Parallel Distributed Systems[1]
• Amdahl's Law
Amdahl's Law is a principle in parallel computing that
defines the theoretical maximum speedup of a task when a
portion of the task is parallelized
S = 1/ α
• Gustafson's Law
• Gustafson's Law is a principle in parallel computing that
addresses the limitations of Amdahl's Law by considering
that workloads can scale with the number of processors.
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
• 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
where the system hides the complexity of data replication from
the user and the application.
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
p 1
(b)
after the occurrence of event e11 and
remains in that state until the
occurrence of event e21
b) 2 processes p1 and p2 1
e
1 e
2
1 e
3
1 e
4
1 e
5
1
event
1 2 3 4
o p1 sends a message to p2 e 2 e 2 e 2 e 2
p 2
p
of communication events. 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
An event service is a
middleware architecture or
(a)
time time
HTTP Communication
request to proxy
(b) communicate HTTP client
Web request to server
through a proxy Browser
Proxy
TCP port 80