MJF Distributed Computing Series 1
MJF Distributed Computing Series 1
Important topics
Snapshot recording algorithm is not in this pdf.
Processing for the Send primitive finishes only when the invoking processor
confirms that the corresponding Receive primitive has been invoked and the
receive operation has completed.
2. Asynchronous Primitives:
DC Series 1 1
A Send primitive is asynchronous if control returns to the invoking process
after the data item has been copied from the user-specified buffer.
3. Blocking Primitives:
Blocking Send: Waits until the sent message is received by the receiver and
acknowledged.
4. Non-blocking Primitives:
DC Series 1 2
Non-blocking Receiver: Continues execution regardless of whether a message
is received.
5. Processor Synchrony:
Processor synchrony means all processors execute at the same time with
synchronized clocks.
Distributed System
A distributed system is a collection of independent entities that cooperate to
solve a problem that cannot be individually solved.
1. Crash tolerance: A single machine failure does not halt the system's ability to
perform work.
DC Series 1 3
2. No shared memory: Each computer operates independently with its own
memory.
4. Autonomy and heterogeneity: Processors have varying speeds and may run
different operating systems, yet cooperate by offering services or solving
problems jointly.
2. Access to geographically remote data and resources: Users can access data
and resources located in different geographical locations.
DC Series 1 4
DC Series 1 5
DC Series 1 6
Vector Time
DC Series 1 7
DC Series 1 8
DC Series 1 9
DC Series 1 10
Bully Algorithm
DC Series 1 11
NOTE : For Understanding
There are three types of messages in the algorithm: election, answer, and
coordinator messages.
A process with the highest ID can declare itself as the coordinator by sending
a coordinator message to processes with lower IDs.
DC Series 1 12
Upon receiving a coordinator message, a process updates its coordinator
variable and acknowledges the new coordinator.
Eventually, only one process continues the election and becomes the new
coordinator.
If it has the highest ID, it wins the election and becomes the coordinator.
The "biggest guy" always wins, hence the name "bully" algorithm.
1. Communication:
1. Processes:
DC Series 1 13
Managing processes/threads, code migration, designing software and
mobile agents.
2. Naming:
3. Synchronization Mechanisms:
6. Fault tolerance:
7. Security:
2. Non-FIFO (N-FIFO): a channel acts like a set in which a sender process adds
messages and receiver removes messages in random order.
DC Series 1 14
3. Causal Ordering (CO): It follows Lamport’s law. This property ensures that
casually related messages destined to the same destination are delivered in an
order that is consistent with their causality relation. It simplifies the design of
distributed algorithms as it provides built in synchronization.
Distributed Program:
DC Series 1 15
1. Internal events
DC Series 1 16
DC Series 1 17
Spanning Tree based Termination Detection
Algorithm
Initially, each leaf process is given a token.
Each leaf process, after it has terminated, sends its token to its parent.
When a parent process terminates and after it has received a token from each
of its children, it sends a token to its parent.
This way, each process indicates to its parent process that the subtree below
it has become idle.
The root of the tree concludes that termination has occurred, after it has
become idle and has received a token from each of its children.
A fixed spanning tree of the graph has process P0 as its root, responsible for
termination detection.
The termination detection algorithm involves two waves of signals: inward and
outward through the spanning tree.
DC Series 1 18
Initially, a contracting wave of signals (tokens) moves inward from leaves to
the root.
If the token wave reaches the root without detecting termination, the root
initiates an outward wave of repeat signals.
As the repeat wave reaches leaves, the token wave reforms and moves inward
again.
DC Series 1 19
DC Series 1 20
YouTube Video Link : https://youtu.be/b3S2pQ6oR60
DC Series 1 21