ricart and agrawala’s algorithm lowkya pothineni

Download Ricart and Agrawala’s Algorithm Lowkya Pothineni

If you can't read please download the document

Upload: shawna-brad

Post on 14-Dec-2015

252 views

Category:

Documents


12 download

TRANSCRIPT

  • Slide 1

Ricart and Agrawalas Algorithm Lowkya Pothineni Slide 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. Slide 3 Algorithm: On initialization state:= RELEASED; To enter the section state:= WANTED; Multicast request to all processes; processing of incoming requests deferred here T:= requests 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; Slide 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. Slide 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. Slide 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 q1s request after exiting the critical section 31 Slide 7 Evaluation: Message complexity : 2(N1) (N1) reply (N1) request Synchronization delay : 1 T ( just one round-trip time ) Slide 8 Program: Slide 9 Slide 10 Slide 11 Slide 12 Slide 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. Slide 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. Slide 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. Slide 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 ulhttp://www.cs.kent.edu/~rkhadse/projects/aos/ricart_agrawala/Rah ul