Presentation is loading. Please wait.

Presentation is loading. Please wait.

Ricart and Agrawala’s Algorithm Lowkya Pothineni.

Similar presentations


Presentation on theme: "Ricart and Agrawala’s Algorithm Lowkya Pothineni."— Presentation transcript:

1 Ricart and Agrawala’s Algorithm Lowkya Pothineni

2 Abstract: The Ricart- Agrawala Algorithm is an algorithm for mutual exclusion on a distributed system. This algorithm is an extension and optimization of Lamport's Distributed Mutual Exclusion Algorithm, by removing the need for release messages. It was developed by Glenn Ricart and Ashok Agrawala.

3 Algorithm: On initialization state:= RELEASED; To enter the section state:= WANTED; Multicast request to all processes; processing of incoming requests deferred here T:= request’s timestamp; Wait until (number of replies received = (N– 1)); state:= HELD; On receipt of a request at pj (i ≤ j) if (state= HELD or (state= WANTED and (T, pj) < (Ti, pi) )) then queue request from pi without replying; else reply immediately to pi; end if To exit the critical section state:= RELEASED; reply to any queued requests;

4 Steps how Algorithm works:  Process requesting the Critical Section(CS): when a process wants to enter the CS, it sends a timestamped request to all other processes.  When a process receives a request: if it is neither requesting nor executing the CS, it returns a reply (not timestamped). If it is requesting the CS, but the timestamp on the incoming request is smaller than the timestamp on its own request, it returns a reply which means the other process requested first. otherwise, it defers answering the request.

5  Process executing the CS: A process enters the CS when it has received a reply from all other processes in the system.  Process releasing the CS: When a process leaves the CS, it: Sends a reply message to all the deferred requests. Process with next earliest request will now received its last reply message and enter the CS.

6 q3 not attempting to enter, p1 and p2 request entry simultaneously q3 replies immediately q2 receives request from q1, timestamp(q2) < timestamp(q1), therefore q2 does not reply q1 sees its timestamp to be larger than that of the request from q2, hence it replies immediately and q2 is granted access q2 will reply to q1’s request after exiting the critical section 31

7 Evaluation: Message complexity : 2(N–1) (N–1) reply (N–1) request Synchronization delay : 1 T ( just one round-trip time )

8 Program:

9

10

11

12

13 Execution: The results of the experiment for Ricart Agrawala Algorithm shows the implementation of the algorithm. The end result is still yet to be obtained However I am trying to obtain the relation between the number of processes and the messages trying to access the CS.

14 Advantages and Disadvantages:  Advantages: Completely distributed and decentralized.  Disadvantages: Every node is a single-point of failure. Slow and costly. For each request O(N) messages are needed.

15 Future Research: Ricart Agrawala can be extended to work on practical network applications. The correctness of the Ricart Agrawala Algorithm should not be affected when inserting new nodes into the network. In practical network insertion of new nodes. Whenever new nodes are added it should be able to update the sequence number, request received and the requests it is going to reply back or acknowledge. Ricart Agrawala can be extended to solve Dining Philosopher's Problem where there are several sites and several number of processes working in each site.

16 References: Maekawa, M.,Oldehoeft, A.,Oldehoeft, R.(1987). Operating Systems: Advanced Concept. Benjamin/Cummings Publishing Company, Inc. Mukesh Singhal "Advanced Concepts in Operating Systems“. Google.co.in Wikipedia.org Referred most and obtained information from “http://www.cs.kent.edu/~rkhadse/projects/aos/ricart_agrawala/Rah ul”http://www.cs.kent.edu/~rkhadse/projects/aos/ricart_agrawala/Rah ul


Download ppt "Ricart and Agrawala’s Algorithm Lowkya Pothineni."

Similar presentations


Ads by Google