0% found this document useful (0 votes)
33 views3 pages

SK Alg

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

SK Alg

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

ROHINI COLLEGE OF ENGINEERING & TECHNOLOGY

SUZUKI–KASAMI‘s BROADCAST ALGORITHM


 Suzuki–Kasami algorithm is a token-based algorithm for achieving mutual exclusion
in distributed systems.
 This is modification of Ricart–Agrawala algorithm, a permission based (Non-token
based) algorithm which uses REQUEST and REPLY messages to ensure mutual
exclusion.
 In token-based algorithms, A site is allowed to enter its critical section if it possesses
the unique token.
 Non-token based algorithms uses timestamp to order requests for the critical section
where as sequence number is used in token based algorithms.
 Each requests for critical section contains a sequence number. This sequence number
is used to distinguish old and current requests.

Fig : Suzuki–Kasami‘s broadcast algorithm

To enter Critical section:


 When a site Si wants to enter the critical section and it does not have the token then it
increments its sequence number RNi[i] and sends a request message REQUEST(i, sn)
to all other sites in order to request the token.
 Here sn is update value of RNi[i]
 When a site Sj receives the request message REQUEST(i, sn) from site Si, it sets
RNj[i] to maximum of RNj[i] and sni.eRNj[i] = max(RNj[i], sn).

CS8603 DISTRIBUTED SYSTEMS


ROHINI COLLEGE OF ENGINEERING & TECHNOLOGY

After updating RNj[i], Site Sj sends the token to site Si if it has token and RNj[i] =
LN[i] + 1

To execute the critical section:


 Site Si executes the critical section if it has acquired the token.

To release the critical section:


After finishing the execution Site Si exits the critical section and does following:
 sets LN[i] = RNi[i] to indicate that its critical section request RNi[i] has been executed
 For every site Sj, whose ID is not prsent in the token queue Q, it appends its ID to Q if
RNj[j] = LN[j] + 1 to indicate that site Sj has an outstanding request.
 After above updation, if the Queue Q is non-empty, it pops a site ID from the Q and
sends the token to site indicated by popped ID.
 If the queue Q is empty, it keeps the token

Correctness
Mutual exclusion is guaranteed because there is only one token in the system and a site
holds the token during the CS execution.
Theorem: A requesting site enters the CS in finite time.
Proof: Token request messages of a site Si reach other sites in finite time.
Since one of these sites will have token in finite time, site S i ’s request will be placed in the
token queue in finite time.
Since there can be at most N − 1 requests in front of this request in the token queue, site S i
will get the token and execute the CS in finite time.
Message Complexity:
The algorithm requires 0 message invocation if the site already holds the idle token at the
time of critical section request or maximum of N message per critical section execution. This
N messages involves
 (N – 1) request messages
 1 reply message

Drawbacks of Suzuki–Kasami Algorithm:


 Non-symmetric Algorithm: A site retains the token even if it does not have requested
for critical section.

CS8603 DISTRIBUTED SYSTEMS


ROHINI COLLEGE OF ENGINEERING & TECHNOLOGY

Performance:
Synchronization delay is 0 and no message is needed if the site holds the idle token at the
time of its request. In case site does not holds the idle token, the maximum synchronization
delay is equal to maximum message transmission time and a maximum of N message is
required per critical section invocation.

CS8603 DISTRIBUTED SYSTEMS

You might also like