0% found this document useful (0 votes)
18 views

Comparative Study of Syn Algo

The document compares four synchronization algorithms in distributed systems: Centralized, Decentralized, Distributed, and Token Ring. Centralized uses one coordinator process to grant permission for shared resource access. Decentralized uses multiple coordinators requiring a majority vote. Distributed has processes broadcast requests to all others. Token Ring passes a token around a virtual ring, with the holding process granted access. The paper analyzes the algorithms based on time complexity, delay, redundancy, scalability, failure rate and recovery, and identifies problems with each approach.

Uploaded by

timeop273
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
18 views

Comparative Study of Syn Algo

The document compares four synchronization algorithms in distributed systems: Centralized, Decentralized, Distributed, and Token Ring. Centralized uses one coordinator process to grant permission for shared resource access. Decentralized uses multiple coordinators requiring a majority vote. Distributed has processes broadcast requests to all others. Token Ring passes a token around a virtual ring, with the holding process granted access. The paper analyzes the algorithms based on time complexity, delay, redundancy, scalability, failure rate and recovery, and identifies problems with each approach.

Uploaded by

timeop273
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 5

A comparative study of synchronization algorithms in

distributed systems

A.S.Kavitha Bai Dr. Jitendranath Mungara


Asst.Professor,Dept of ISE Professor & Dean, Dept of CSE& ISE
CMR Institute of Technology, CMR Institute of Technology,
Bangalore-37 Bangalore-37

Abstract 2. Synchronization Algorithms

A distributed system is a collection of independent In centralized algorithm, One process is elected as the
computers that appears to its users as a single coherent coordinator. Whenever a process wants to access a
system and sharing the common resources. Multiple shared resource, it sends a request message to the
processes do not simultaneously access a shared coordinator stating which resource it wants to access
resource so, requires the synchronization. We are and asking for permission. If no other process is
having the four synchronization algorithms in currently accessing that resource, the coordinator sends
distributed systems. back a reply granting permission with OK message.
When the reply arrives, the requesting process can go
This paper describes the pros & cons of each algorithm. ahead. At the same time another process asks for
In this we are comparing these four algorithms permission to access the resource. The coordinator
(Centralized, Decentralized, Distributed and Token knows that a different process is already at the
Ring algorithms) with appropriate comparative resource, so it cannot grant permission. The coordinator
measurements such as time complexity, delay, blocks the 2nd process which is waiting for a reply.
redundancy, scalability, failure rate &recovery. Based When process 1 is finished with the resource, it sends a
on this comparative study in future we are going to message to the coordinator releasing the resource, which
address the problems in the existing synchronization then replies to process2 with OK message.
algorithms.
In Centralized system having one coordinator is a poor
1. Introduction
approach. So, we are moving to Decentralized system.
In this the no of coordinators should be m>n/2.
Whenever a process wants to access the resource, it will
A distributed system is one in which components
simply need to get a majority vote from 111 > nl2
located at networked computers communicate and
coordinators. Unlike in the centralized scheme
coordinate their actions only by passing messages. The
discussed before, we assume that when a coordinator
sharing of resources is a main motivation for
does not give permission to access a resource (which it
constructing distributed systems [1].The concurrency
will do when it had granted permission to another
and collaboration occurs among multiple processes, so
process), it will tell the requester. This scheme
to prevent such concurrent accesses corrupt the
essentially makes the original centralized solution less
resources (or) inconsistent solutions are required to
vulnerable to failures of a single coordinator. The
grant mutual exclusive access by processes [2].Many
assumption is that when a coordinator crashes, it
distributed systems requires one process should act as
recovers quickly but will have forgotten any vote it gave
coordinator and the coordinator responsibilities are
before it crashed. Another way of viewing this is that a
managing the message passing and allocation of
coordinator resets itself at arbitrary moments. The risk
resources. This coordinator will be elected from all
that we are taking is that a reset will make the
other process in the group using various types of
coordinator forget that it had previously granted
algorithms such as Centralized, Decentralized,
permission to some process to access the resource. As a
Distributed and Token Ring algorithms. Next Section
consequence, it may incorrectly grant this permission
will discuss these algorithms in detail.
again to another process after its recovery.

978-1-4577-1088-9/11/$26.00 ©2011 IEEE


In distributed algorithm when a process wants to access a process acquires the token from its neighbor, it checks
a shared resource, it builds a message containing the to see if it needs to access the shared resource. If so, the
name of the resource, its process number, and the process goes ahead, does all the work it needs to, and
current (logical) time. It then sends the message to all releases the resources. After it has finished, it passes the
other processes, conceptually including itself. Suppose token along the ring. It is not permitted to
two processes want to enter the same critical region at immediately enter the resource again using the same
the same moment. If the process1 has the lowest time token. If a process is handed the token by its neighbor
stamp, it will win else process 2 will win. Assume and is not interested in the resource, it just passes the
process 1 won, when it is done it sends OK message to token along. As a consequence, when no processes need
process 2 .Now process 2 can now enter critical region. the resource, the token just circulates at high speed
around the ring.
A completely different approach to deterministically
achieving mutual exclusion in a distributed system is 3. Parameters used in Comparative study
token ring algorithm. Algorithm works by passing a
token around the ring. When the ring is initialized, 1) Time complexity 2) delay 3) redundancy 4)
process 0 is given a token. The token circulates around Scalability 5) failure rate 6) recovery 7)Coordinator
the ring. It is passed from process k to process k +1 selection 8) No of messages 9) Messages per entry/exit
(modulo the ring size) in point-to-point messages. When 10) Delay before entry 11) problems

4. Comparative Study of Synchronization algorithms


Measurement

Time complexity
Centralized

O(n)
Decentralized

O(n)
Distributed

O(n)
Token Ring

O(n)
Delay in terms of Message
communication (n- 1) (nlm)- 1 2(n-l) n

Redundancy
NO YES NO NA

Scalability
lO<n< 100 1OO<n< 1000 1OOO<n< 10000 lO<n< 100

Failure rate Single point No Single point No Single point


n
Failure Failure Failure
Recovery
n-l n-m n 0

Coordinator selection Based on Based on


Election Election No Coordinator No Coordinator
Algorithm Algorithm

No of messages 2
n+2 3m(nlm-l) n +2n-2 n

Messages per entry/exit


3 3mk,k=I,2,3 . . . 2(n-l) Ito 00

Delay before entry 2 2m 2(n-l) o to n-l

problems Coordinator Starvation, low Crash of any Lost Token


Crash efficiency process ,Process Crash
Time complexity is time taken for executing for an group. Maximum this algorithm will be suit for 10 to
algorithm. Time complexity in centralized algorithm is 100 processes. The decentralized algorithm having m
O(n) because time taken to send the resource to all other coordinators because of that this algorithm will work
processes except the coordinator .so that is n-l.The time fine with increasing the scalability from 100 to 1000
complexity will be O(n).Time complexity in processes. In distributed algorithm the job can be
decentralized algorithm is O(n) because time taken to distributed among all nodes present in the system. so
send the resource to all other processes except the m scalability increased from 1000 to 10000 processes. In
coordinators .so that is n-m. The time complexity will be token ring algorithm, if the token will be lost then the
O(n).Time complexity in distributed algorithm is O(n) ring will be break. so it will be suitable for small group
because time taken to send the resource to all other of processes such as 10 to 100 processes.
processes. so that is n. So the time complexity will be
O(n).Time complexity in Token ring algorithm is O(n) Failure rates The probability of failure per unit of time
because time taken to send the resource to all other of items in operation; sometimes estimated as a ratio of
processes except the coordinator .so that is n-l.the time the number of failures to the accumulated operating
complexity will be O(n). time for the items. In centralized algorithm if the
coordinator crashes, the entire system may go down. so
Delay is time lag between the departure of a message single point of failure will be there. In decentralized
from the source and the arrival of the signal at algorithm there is more than one coordinator, so no
destination. The delay in centralized algorithm is n-l.In single point of failure. In distributed algorithm there is
this algorithm there is one coordinator, it should send the no coordinator at all, so no single point of failure. In
messages to remaining all other processes ,so the delay token ring algorithm if one process crash and token lost
of the message communication will be n-l.In entire system may go down so it is n point of failure.
decentralized algorithm there are m coordinators. All
these m coordinators should send the messages to Recovery a process of attempting to change
remaining all other processes i.e n-m processes. The dysfunctional behavior
distribution of messages will be done by m coordinators.
So it will be (n-m)/m i.e (n/m)-I.In distributed algorithm In centralized algorithm the recover happen from
there is no coordinator. The distributed algorithm among remaining n-l processes. In decentralized
requires n - 1 request messages, one to each of the other algorithm the recovery happen from among n-m
processes, and an additional n - 1 grant messages, for a processes. In distributed algorithm if one process
total of 2(n- 1) messages. In Token ring algorithm token becomes failure, then remaining processes will be
will be passed in circular ring. So, if n processes are distributing that work. In token ring algorithm the
there then delay of message communication will be 'n'. recovery will not happen because ring get disconnected.

Redundancy information is unneeded or duplicated Coordinator selection


information.
In centralized algorithm there is a coordinator .The
In centralized algorithm because of single coordinator coordinator selection will be based on the election
there will not be any duplication of messages. In algorithms present in distributed systems. In
decentralized algorithm because of multiple decentralized algorithm there is a m coordinators .The
coordinators there is a chance of duplication of coordinator selection will be based on the election
messages. The distributed algorithm has no coordinator algorithms present in distributed systems. In distributed
so, there is no chance of duplication of messages. In algorithm and in token ring algorithm there is no
token ring algorithm the token is passing through the coordinator only.
ring so, redundancy will not be there in this.
No of messages
Scalability is the ability of a system, network, or
process, to handle growing amounts of work in a
In centralized algorithm, there are 3 messages like
graceful manner or its ability to be enlarged to
request ,OK & release .One process it will send one
accommodate that growth. The centralized algorithm
request message to coordinator then it will send back
will give good results of small no of processes in the
one OK message to that particular process. so total 2
messages, and at the same time the remammg n-2 Delay in terms of Message communication, this
processes also send request messages to coordinator the algorithm should contain less than or equal to nlm-l.
no of messages will be n-2 messages. Then the first
process finish the resource then it send release message Redundancy should be there in this algorithm.
to coordinator & coordinator send OK message to the
next process which is there in the queue. So totally 2+
Scalability should exist for any number of processes.
(n-2) +1+1=n+2 messages. In distributed algorithm, in
worst case if n processes send the time stamps to
There will not be any failure in this algorithm; In case
everybody and itself also then no of messages will be
of failure auto recovery should exist.
n*n. Then the process which is having lowest time
stamp it will win & it will get OK messages from
remaining n-l messages so the no of messages are n-l. Coordinator selection should be based on the
Now Ok messages will go from remaining n-2 effective election algorithm.
processes to the process which is having second lowest
time stamp .the no of messages will be n-2 messages. No Of Messages should be less than or equal to n
Now the lowest timestamp process will release the messages.
resource and send OK message to the next lowest time
stamp process. 6. Conclusion & Future Enhancements

So total no of messages are This paper describes A Comparative study of


synchronization algorithms in distributed systems, in
(n*n)+(n-l)+(n-2)+1= n2+2n-2 the comparative study observed that every algorithm is
suffering with certain limitations. To address these
Messages per entry/exit limitations a new algorithm is required.

The centralized algorithm requires only three messages Based on the limitations identifies in existing
to enter and leave a critical region: a request, a grant to synchronization algorithms a new algorithm need to be
enter, and a release to exit. The distributed algorithm developed and followed by experiments to demonstrate
requires n - 1 request messages, one to each of the other the proposed algorithm is efficient than the existing
processes, and an additional n - 1 grant messages, for a synchronization algorithm.
total of 2(n- 1). With the token ring algorithm, the
number is variable. If every process constantly wants to References
enter a critical region. Then each token pass will result
in one entry and exit, for an average of one message per 1)[Tanenbaum , 2006]Andre S. Tanenbaum , Maarten
critical region entered. At the other extreme, the token Van Steen, "Distributed systems principles and
may sometimes circulate for hours without anyone paradigms" 2nd edition Pearson, 2007.
being interested in it. In this case, the number of
messages per entry into a critical region is unbounded. 2)[George,2000]George Coulouris, Jean Dollimore,
Tim Kindberg,"Distributed systems concepts and
5. Proposed Synchronization Algorithm Design" 3rd edition Pearson, 2001.

Based on the comparison among the synchronization 3) M. Raynal, Algorithms for Mutual Exclusion.
algorithms shown in table l.l,every algorithm is Cambridge, MA: MIT Press, 1st ed., 1986.
lacking in certain comparative parameters. A new
synchronization algorithm is required to overcome 4) K. Raymond, "A distributed algorithm for multiple
these limitations. This new algorithm should poses the entries to a critical section,"
following characteristics: Information Processing Letters, vol. 30, pp. 189-193,
Feb. 1989.
Time complexity for all old 4 algorithms is O(n).This
proposed algorithm should get less than or equal to 5) Lodha, S. Kshemkalyani, A.
O(n). Synposys Inc., Mountain View, CA(2000) A fair
distributed mutual exclusion algorithm Parallel and in 4th WSEAS international conference on soft
Distributed Systems IEEE Transactions on june 2000 computing ,optimization. simulation and modeling
Volume: 11 Issue 6 On page(s): 537 - 549. ,April 21-23 ,2004,Florida,USA.

6) Quazi Ehsanul Kabir mamun,mortuza ali,salahudin 7) Shailaja Bulgannawar Nitin H. Vaidya, A


mohammad masum, A Two-Layer Hybrid Algorithm Distributed K-Mutual Exclusion Algorithm, IEEE
for Achieving Mutual Exclusion in distributed systems Transaction on computers in 1995 page(s)153-160

You might also like