A Tree Based Algorithm fro Distributed Mutual Exclusion Addy Gronquist 11/19/2003.

Slides:



Advertisements
Similar presentations
Global States.
Advertisements

CS542 Topics in Distributed Systems Diganta Goswami.
CS3771 Today: deadlock detection and election algorithms  Previous class Event ordering in distributed systems Various approaches for Mutual Exclusion.
Token-Dased DMX Algorithms n LeLann’s token ring n Suzuki-Kasami’s broadcast n Raymond’s tree.
Process Synchronization Continued 7.2 The Critical-Section Problem.
Mutual Exclusion By Shiran Mizrahi. Critical Section class Counter { private int value = 1; //counter starts at one public Counter(int c) { //constructor.
Silberschatz, Galvin and Gagne ©2009 Operating System Concepts – 8 th Edition, Chapter 6: Process Synchronization.
Multiprocessor Synchronization Algorithms ( ) Lecturer: Danny Hendler The Mutual Exclusion problem.
Synchronization Chapter clock synchronization * 5.2 logical clocks * 5.3 global state * 5.4 election algorithm * 5.5 mutual exclusion * 5.6 distributed.
1 Algorithms and protocols for distributed systems We have defined process groups as having peer or hierarchical structure and have seen that a coordinator.
Page 1 Mutual Exclusion* Distributed Systems *referred to slides by Prof. Paul Krzyzanowski at Rutgers University and Prof. Mary Ellen Weisskopf at University.
CS 582 / CMPE 481 Distributed Systems
What we will cover…  Distributed Coordination 1-1.
Shared Memory Coordination We will be looking at process coordination using shared memory and busy waiting. –So we don't send messages but read and write.
Synchronization in Distributed Systems. Mutual Exclusion To read or update shared data, a process should enter a critical region to ensure mutual exclusion.
Operating Systems, 2011, Danny Hendler & Amnon Meisels 1 Distributed Mutual Exclusion  Introduction  Ricart and Agrawala's algorithm  Raymond's algorithm.
Chapter 18: Distributed Coordination (Chapter 18.1 – 18.5)
EEC-681/781 Distributed Computing Systems Lecture 11 Wenbing Zhao Cleveland State University.
P2P Course, Structured systems 1 Introduction (26/10/05)
Computer Science Lecture 12, page 1 CS677: Distributed OS Last Class Vector timestamps Global state –Distributed Snapshot Election algorithms.
Dr. Kalpakis CMSC 621, Advanced Operating Systems. Fall 2003 URL: Distributed Mutual Exclusion.
Distributed Mutual Exclusion
Tanenbaum & Van Steen, Distributed Systems: Principles and Paradigms, 2e, (c) 2007 Prentice-Hall, Inc. All rights reserved Chapter 6 Synchronization.
1 COP 3538 Data Structures with OOP Chapter 8 - Part 2 Binary Trees.
Performance of Token- based Distributed Mutual Exclusion Algorithms Scott J. McCallen Kent State University November
1 A Mutual Exclusion Algorithm for Ad Hoc Mobile networks Presentation by Sanjeev Verma For COEN th Nov, 2003 J. E. Walter, J. L. Welch and N. Vaidya.
CSE 486/586, Spring 2013 CSE 486/586 Distributed Systems Mutual Exclusion Steve Ko Computer Sciences and Engineering University at Buffalo.
4.5 DISTRIBUTED MUTUAL EXCLUSION MOSES RENTAPALLI.
4.5 Distributed Mutual Exclusion Ranjitha Shivarudraiah.
CSE 486/586, Spring 2012 CSE 486/586 Distributed Systems Mutual Exclusion Steve Ko Computer Sciences and Engineering University at Buffalo.
Maekawa’s algorithm Divide the set of processes into subsets that satisfy the following two conditions: i  S i  i,j :  i,j  n-1 :: S i  S j.
Computer Science Lecture 12, page 1 CS677: Distributed OS Last Class Vector timestamps Global state –Distributed Snapshot Election algorithms –Bully algorithm.
Chapter 2/6 –Critical Section Problem / Mutual exclusion progress, bounded wait –Hardware Solution disable interrupts –problems ? –Software Solution busy.
Operating Systems Distributed Coordination. Topics –Event Ordering –Mutual Exclusion –Atomicity –Concurrency Control Topics –Event Ordering –Mutual Exclusion.
CS425 /CSE424/ECE428 – Distributed Systems – Fall 2011 Material derived from slides by I. Gupta, M. Harandi, J. Hou, S. Mitra, K. Nahrstedt, N. Vaidya.
Coordination and Agreement. Topics Distributed Mutual Exclusion Leader Election.
Presenter: Long Ma Advisor: Dr. Zhang 4.5 DISTRIBUTED MUTUAL EXCLUSION.
11/18/20151 Operating Systems Design (CS 423) Elsa L Gunter 2112 SC, UIUC Based on slides by Roy Campbell, Sam.
Studying Different Problems from Distributed Computing Several of these problems are motivated by trying to use solutiions used in `centralized computing’
Lecture 10 – Mutual Exclusion Distributed Systems.
Operating Systems CMPSC 473 Mutual Exclusion Lecture 11: October 5, 2010 Instructor: Bhuvan Urgaonkar.
CSE 486/586, Spring 2012 CSE 486/586 Distributed Systems Mutual Exclusion & Leader Election Steve Ko Computer Sciences and Engineering University.
ITEC452 Distributed Computing Lecture 6 Mutual Exclusion Hwajung Lee.
Hwajung Lee. Mutual Exclusion CS p0 p1 p2 p3 Some applications are:  Resource sharing  Avoiding concurrent update on shared data  Controlling the.
Hwajung Lee. Mutual Exclusion CS p0 p1 p2 p3 Some applications are: 1. Resource sharing 2. Avoiding concurrent update on shared data 3. Controlling the.
Page 1 Mutual Exclusion & Election Algorithms Paul Krzyzanowski Distributed Systems Except as otherwise noted, the content.
Lecture 12-1 Computer Science 425 Distributed Systems CS 425 / CSE 424 / ECE 428 Fall 2012 Indranil Gupta (Indy) October 4, 2012 Lecture 12 Mutual Exclusion.
Lecture 7- 1 CS 425/ECE 428/CSE424 Distributed Systems (Fall 2009) Lecture 7 Distributed Mutual Exclusion Section 12.2 Klara Nahrstedt.
1 Chapter 11 Global Properties (Distributed Termination)
CIS 825 Review session. P1: Assume that processes are arranged in a ring topology. Consider the following modification of the Lamport’s mutual exclusion.
Mutual Exclusion Algorithms. Topics r Defining mutual exclusion r A centralized approach r A distributed approach r An approach assuming an organization.
Token-passing Algorithms Suzuki-Kasami algorithm The Main idea Completely connected network of processes There is one token in the network. The holder.
CS3771 Today: Distributed Coordination  Previous class: Distributed File Systems Issues: Naming Strategies: Absolute Names, Mount Points (logical connection.
CSC 8420 Advanced Operating Systems Georgia State University Yi Pan Transactions are communications with ACID property: Atomicity: all or nothing Consistency:
CS 425 / ECE 428 Distributed Systems Fall 2015 Indranil Gupta (Indy) Oct 1, 2015 Lecture 12: Mutual Exclusion All slides © IG.
Mutual Exclusion Continued
Distributed Mutual Exclusion
A Mutual Exclusion Algorithm for Ad Hoc Mobile Networks
Comparison between Suzuki Kasami’s and Raymond’s Tree Algorithm
Raymond'S Tree DMX Algorithm
Distributed Mutual Exclusion
Raymond Exclusive Algorithm
ITEC452 Distributed Computing Lecture 7 Mutual Exclusion
Outline Distributed Mutual Exclusion Introduction Performance measures
Mutual Exclusion CS p0 CS p1 p2 CS CS p3.
CSE 486/586 Distributed Systems Mutual Exclusion
Synchronization (2) – Mutual Exclusion
Distributed Mutual Exclusion
Distributed Systems and Concurrency: Synchronization in Distributed Systems Majeed Kassis.
CSE 486/586 Distributed Systems Mutual Exclusion
Presentation transcript:

A Tree Based Algorithm fro Distributed Mutual Exclusion Addy Gronquist 11/19/2003

Introduction Developed by Kerry Raymond in 1989 In progression: Ricart/Agrawala : 2*(N-1) messages Suzuki/Kasami : N messages Maekawa : sqrt(N) messages Raymond : log(N) messages

Basic Ideas Nodes arranged as an rooted tree, whose root will periodically change Entry to critical sections controlled by possesion of token called PRIVILEGE Only knowledge of neighbor nodes is required via the HOLDER variable, which points to the neighbor who is on the way to the node with the TOKEN (scales well)

Basic Topology

Initialization The algorithm requires nodes to already be set up in a tree, which can be physical topology or only logical, although physical is most efficient. This tree must be rooted somewhere, the root node will be the initial token holder.

Per Node Data HOLDER: contains either ‘self’ if a node holds the PRIVILEGE, or the name of the neighbor node in the tree whose subtree contains the PRIVILEGE USING: a flag for whether the node is currently using the PRIVILEGE (which it must hold, of course)

Per Node Data (cont.) REQUEST_Q: FIFO queue of node names, including self, that have requested the PRIVILEGE via the node ASKED: a flag to determine if the node has requested the PRIVILEGE from its HOLDER yet (this lets us make only one request per node, later queue entries will not generate MAKE_REQUEST message)

Messages ASSIGN_PRIVILEGE: this is the message where the token is passed Conditions: HOLDER==self ^ !USING ^ REQUEST_Q != empty ^ head(REQUEST_Q) != self Effects: HOLDER=dequeue(REQUEST_Q), ASKED = false, send PRIVILEGE to HOLDER Else, if head(REQUEST_Q) == self, set USING = true and use the protected resource

Messages (cont.) MAKE_REQUEST: Sent once, the first time a node recieves a request (from self or other) for the PRIVILEGE that it does not hold. Conditions: HOLDER != self ^ REQUEST_Q != empty ^ !ASKED Effects: ASKED = true, send to HOLDER, at HOLDER node we enqueue the name of the neighbor node the MAKE_REQUEST came from to the REQUEST_Q

Events There are four events that occur in our system: 1) A node wishes to enter critical section 2) A node receives a request for token 3) A node receives the token 4) A node finishes using the token We will discuss each in turn in the next 4 slides

Events (want to enter) When a node wishes to use the protected resource, it enqueues itself onto its REQUEST_Q, then runs either ASSIGN_PRIVILEGE if it is the token holder, or MAKE_REQUEST if it is not

Events (receive request) When a node receives a request from a neighbor for the token, it enqueues the neighbors name into its REQUEST_Q, then either runs ASSIGN_PRIVILEGE if it is the token holder, or runs MAKE_REQUEST if it is not, which propogates the request on towards the holder, with each node acting as a proxy for its entire subtree.

Events (receive PRIVILEGE) When a node receives the PRIVILEGE token, it sets HOLDER = self, then calls either ASSIGN_PRIVILEGE or MAKE_REQUEST as above

Events (exit Mutex) When a node finishes personally using the token, it sets USING = false, and then runs ASSIGN_PRIVILEGE or MAKE_REQUEST as above

Message Overtaking Unlike other algorithms, this handles routing on its own (which is why using logical topolgy matching the physical topology makes this run the best), so there is little chance of message overtaking, and the algorithm is resilient to overtakes anyways, so they don’t matter

Proofs of Operation Mutual Exclusion: only one node can hold at a time (or zero during token transit) Deadlock Free: three cases 1)No PRIVILEGE: can’t happen 2)Doesn’t know to pass: ASKED and REQUEST messages ensure this is not so 3)Token holder doesn’t know to send: can’t happen, REQUEST_Qs along path to requesting node form the path to take and are acyclic, so no ‘looping chase’ phenomenon

Proofs of Operation Starvation Imossible: Complicated proof, but based on the FIFO nature of the queueing Message Volume: worst-case: straight line tree: O(N) regular-case: radiating star: O(log N) Simulations have shown that the regular case is basically always the case

Performance Under Load Suprising Feature: performance increases to O(1)! Basically, every other message sent will be a PRIVILEGE, and the other half will be REQUESTS, so no PRIVILEGE goes more than two nodes without an entry, on average

Variations Piggyback: Aggregate MAKE_REQUEST messages onto PRIVILEGE messages that are immediately preceding them. Works especially well under heavy load Greedy: undo FIFO requirement, so that nodes always service themselves first. This makes us not need to send a request immediately following a token as above, but it trades fairness for inceased efficiency.

Node Failure All previous discussion assumed no failures. Failure of single node is OK, it can get all info back from neighbors using a special INQUIRE message Failure of multiple is OK, as long as no two are adjacent, otherwise request info will be lost.