Download presentation
Presentation is loading. Please wait.
Published byGiles Robertson Modified over 9 years ago
1
DISTRIBUTED SYSTEMS II A POLYNOMIAL LOCAL SOLUTION TO MUTUAL EXCLUSION Prof Philippas Tsigas Distributed Computing and Systems Research Group
2
Doorways Doorway is a separation mechanism of two areas. Processes which pass a doorway at time T prevent neighbor processes entering the same area at a greater time than T until exiting the doorway.
3
Asynchronous Doorway Enry CodeExit Code m1 is the “I am going in” message
4
Behavior
5
Problem with the Asynchronous Doorway
6
Synchronous Doorway A process which desires to enter a synchronous doorway is required to wait for a situation in which all its neighbors are outside the doorway. This is implemented by checking for a process the states of its neighbors before it enters the doorway.
7
Synchronous Doorway Entry code:Exit code:
8
What Can Go Wrong?
9
What if We Combine?
11
LINK REVERSAL ALGORITHMS Based on slides from Jennifer Welch
12
12 What is Link Reversal? Distributed algorithm design technique Used in solutions for a variety of problems –routing, leader election, mutual exclusion, scheduling, resource allocation,… Model problem as a directed graph and reverse the direction of links appropriately Use local knowledge to decide which links to reverse
13
Routing [Gafni & Bertsekas 1981] Undirected connected graph represents communication topology of a system Unique destination node Assign virtual directions to the graph edges (links) s.t. –if nodes forward messages over the links, they reach the destination Directed version of the graph (orientation) must –be acyclic –have destination as only sink Thus every node has path to destination. 13
14
Routing Example 14 D 12 3 456
15
Mending Routes What happens if some edges go away? –Might need to change the virtual directions on some remaining edges (reverse some links) More generally, starting with an arbitrary directed graph, each node should decide independently which of its incident links to reverse 15
16
Mending Routes Example 16 D 12 3 456
17
Sinks A vertex with no outgoing links is a sink. The property of being a sink can be detected locally. A sink can then reverse some incident links Basis of several algorithms… 17
18
Full Reversal Routing Algorithm 18 Input: directed graph G with destination vertex D Let S(G) be set of sinks in G other than D while S(G) is nonempty do –reverse every link incident on a vertex in S(G) –G now refers to resulting directed graph
19
19 Full Reversal (FR) Routing Example D 1 2 3 4 5 6 D 1 2 3 4 5 6 D 1 2 3 4 5 6 D 12 3 4 5 6 D 1 2 3 4 5 6 D 1 2 3 4 5 6
20
Why Does FR Terminate? Suppose it does not. Let W be vertices that take infinitely many steps. Let X be vertices that take finitely many steps; includes D. Consider neighboring nodes w in W, x in X. Consider first step by w after last step by x: link is w x and stays that way forever. Then w cannot take any more steps, contradiction. 20
21
Why is FR Correct? Assume input graph is acyclic. Acyclicity is preserved at each iteration: –Any new cycle introduced must include a vertex that just took a step, but such a vertex is now a source (has no incoming links) When FR terminates, no vertex, except possibly D, is a sink. A DAG must have at least one sink: –if no sink, then a cycle can be constructed Thus output graph is acyclic and D is the unique sink. 21
22
References Resource Allocation and Link Reversal Dijkstra, E. W. (1971, June). Hierarchical ordering of sequential processes. Acta Informatica 1(2): 115-138. Chandy, K.M.; Misra, J. (1984). The Drinking Philosophers Problem. ACM Transactions on Programming Languages and Systems. Nancy A. Lynch. Upper bounds for static resource allocation in a distributed system Journal for Computer and System Sciences, 23:254-278, 1981 Manhoi Choy and Ambuj K. Singh. Efficient fault-tolerant algorithms for distributed resource allocation. ACM Transactions on Programming Languages and Systems, 17(3):535-559, May 1995. Gafni and Bertsekas, “Distributed Algorithms for Generating Loop-Free Routes in Networks with Frequently Changing Topology,” IEEE Trans. Comm. 1981. Welch and Walter, “Link Reversal Algorithms,” Synthesis Lectures on Distributed Computing Theory #8, Morgan & Claypool Publishers, 2012. 22
Similar presentations
© 2024 SlidePlayer.com. Inc.
All rights reserved.