0% found this document useful (0 votes)
8 views14 pages

Unit - 2

The document discusses synchronous program order in asynchronous distributed systems, highlighting non-determinism and the importance of rendezvous systems for synchronous communication. It details the binary rendezvous algorithm, including steps to prevent deadlock and manage message types, as well as group communication methods like multicast and causal order protocols. Additionally, it describes the Raynal–Schiper–Toueg algorithm for maintaining causal order in message delivery.

Uploaded by

dharani
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
8 views14 pages

Unit - 2

The document discusses synchronous program order in asynchronous distributed systems, highlighting non-determinism and the importance of rendezvous systems for synchronous communication. It details the binary rendezvous algorithm, including steps to prevent deadlock and manage message types, as well as group communication methods like multicast and causal order protocols. Additionally, it describes the Raynal–Schiper–Toueg algorithm for maintaining causal order in message delivery.

Uploaded by

dharani
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 14

CS3551 – DISTRIBUTED COMPUTING

02/20/2025 1
SYNCHRONOUS PROGRAM ORDER ON AN ASYNCHRONOUS
SYSTEM

Non deterministic programs


 The partial ordering of messages in the distributed systems makes the repeated
runs of the same program will produce the same partial order, thus preserving
deterministic nature.
But sometimes the distributed systems exhibit non determinism:
A receive call can receive a message from any sender who has sent a
message, if the expected sender is not specified.
Multiple send and receive calls which are enabled at a process can be
executed in an interchangeable order.
If i sends to j, and j sends to i concurrently using blocking
synchronous calls, there results a deadlock.
There is no semantic dependency between the send and the
immediately following receive at each of the processes.
If the receive call at one of the processes can be scheduled before the
send call, then there is no deadlock.

02/20/2025 2
Contd…..

• Rendezvous
 Rendezvous systems are a form of synchronous
communication among an arbitrary number of
asynchronous processes.
 The entire processes involved meet with each other,
i.e., communicate synchronously with each other at one
time.
 Two types of rendezvous systems are possible:
 Binary rendezvous: When two processes agree to
synchronize.
 Multi-way rendezvous: When more than two processes
agree to synchronize.
02/20/2025 3
Contd…..

• Features of binary rendezvous:


 For the receive command, the sender must be specified.
However, multiple receive commands can exist. A type check
on the data is implicitly performed.
 Send and received commands may be individually disabled or
enabled. A command is disabled if it is guarded and the guard
evaluates to false. The guard would likely contain an expression
on some local variables.
 Synchronous communication is implemented by scheduling
messages under the covers using asynchronous communication.
 Scheduling involves pairing of matching send and receives
commands that are both enabled.
 The communication events for the control messages under the
covers do not alter the partial order of the execution.
02/20/2025 4
Contd…..

• Binary rendezvous algorithm


 If multiple interactions are enabled, a process
chooses one of them and tries to synchronize with the
partner process.
 The problem reduces to one of scheduling messages
satisfying the following constraints:

Schedule on-line, atomically, and in a distributed manner.


Schedule in a deadlock-free manner (i.e., crown-free).
Schedule to satisfy the progress property in addition to the
safety property.

02/20/2025 5
Contd…..

• Steps in Bagrodia algorithm:

Receive commands are forever enabled from all processes.


 A send command, once enabled, remains enabled until it
completes, i.e., it is not possible that a send command gets before
the send is executed.
To prevent deadlock, process identifiers are used to introduce
asymmetry to break potential crowns that arise.
Each process attempts to schedule only one send event at any
time.

02/20/2025 6
Contd…..

The message (M) types used are:


M, ack(M), request(M), and permission(M).
 Execution events in the synchronous execution are only the
send of the message M and receive of the message M.
 The send and receive events for the other message types –
ack(M), request(M), and permission(M) which are control
messages.
 The messages request(M), ack(M), and permission(M) use M’s
unique tag; the message M is not included in these messages.

02/20/2025 7
Bagrodia Algorithm
M, ack(M), request(M), permission(M)

(1) Pi wants to execute SEND(M) to a lower priority process Pj:


Pi executes send(M) and blocks until it receives ack(M) from Pj .
The send event SEND(M) now completes.
Any M’ message (from a higher priority processes) and
request(M’) request for synchronization (from a lower priority
processes) received during the blocking period are queued.
(2) Pi wants to execute SEND(M) to a higher priority process Pj:
(2a) Pi seeks permission from Pj by executing send(request(M)).
// to avoid deadlock in which cyclically blocked processes queue //
messages. (2b) While Pi is waiting for permission, it remains
unblocked.

02/20/2025 8
Contd…..
 If a message M’ arrives from a higher priority process P , P accepts
k i

M’ by scheduling a RECEIVE(M’) event and then executes


send(ack(M’)) to P . k

 If a request(M’) arrives from a lower priority process P , P executes


k i

send(permission(M’)) to P and blocks waiting for the messageM’.


k

WhenM’ arrives, the RECEIVE(M’) event is executed.


(2c) When the permission(M) arrives, P knows partner P is
i j

synchronized and P executes send(M). The SEND(M) now


i

completes.
(3) request(M) arrival at P from a lower priority process P :
i j

At the time a request(M) is processed by P , process P


i i

executes send(permission(M)) to Pj and blocks waiting for the


message M. When M arrives, the RECEIVE(M) event is
executed and the process unblocks.
02/20/2025 9
Contd…..

(4)Message M arrival at Pi from a higher priority process Pj:


At the time a message M is processed by Pi, process Pi executes
RECEIVE(M) (which is assumed to be always enabled) and then
send(ack(M)) to Pj .
(5)Processing when Pi is unblocked:
When Pi is unblocked, it dequeues the next (if any) message from the
queue and processes it as a message arrival (as per rules 3 or 4).

02/20/2025 10
GROUP COMMUNICATION

 Group communication is done by broadcasting of messages.


 A message broadcast is the sending of a message to all members in the
distributed system.
 The communication may be
 Multicast: A message is sent to a certain subset or a group.
 Unicasting: A point-to-point message communication.

 The network layer protocol cannot provide the following functionalities:


 Application-specific ordering semantics on the order of delivery of
messages.
 Adapting groups to dynamically changing membership.
 Sending multicasts to an arbitrary set of processes at each send event.
 Providing various fault-tolerance semantics.
 The multicast algorithms can be open or closed group.

02/20/2025 11
Contd…
Differences between closed and open group algorithms:
Closed group algorithms
If sender is also one of the receiver in the multicast algorithm,
then it is closed group algorithm.
They are specific and easy to implement.
It does not support large systems where client processes have
short life.
Open group algorithms
If sender is not a part of the communication group, then it is open group
algorithm.
They are more general, difficult to design and expensive.
It can support large systems.

02/20/2025 12
CAUSAL ORDER (CO)
 In the context of group communication, there are two
modes of communication:
 causal order
 total order.
The following two criteria must be met by a causal
ordering protocol:
Safety: In order to prevent causal order from being violated, a
message M that arrives at a process may need to be buffered
until all system wide messages sent in the causal past of the send
(M) event to that same destination have already arrived. The
arrival of a message is transparent to the application process.
Liveness: A message that arrives at a process must eventually be
delivered to the process.

02/20/2025 13
Contd…
The Raynal–Schiper–Toueg algorithm
– Each message M should carry a log of all other messages sent causally
before M’s send event, and sent to the same destination dest(M).
– The Raynal–Schiper–Toueg algorithm canonical algorithm is a
representative of several algorithms that reduces the size of the local
space and message space overhead by various techniques.
– This log can then be examined to ensure whether it is safe to deliver a
message.
– All algorithms aim to reduce this log overhead, and the space and time
overhead of maintaining the log information at the processes.
– To distribute this log information, broadcast and multicast communication
is used.

02/20/2025 14

You might also like