1 / 22

Distributed systems II A polynomial local solution to Mutual Exclusion

Prof Philippas Tsigas Distributed Computing and Systems Research Group. Distributed systems II A polynomial local solution to Mutual Exclusion. Doorways. Doorway is a separation mechanism of two areas.

luke
Télécharger la présentation

Distributed systems II A polynomial local solution to Mutual Exclusion

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Prof Philippas Tsigas Distributed Computing and Systems Research Group Distributedsystems IIA polynomial local solution to Mutual Exclusion

  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 EnryCode ExitCode m1 is the “I am going in” message

  4. Behavior

  5. Problem with the AsynchronousDoorway

  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 Entrycode: Exitcode:

  8. What Can Go Wrong?

  9. WhatifWeCombine?

  10. Based on slides from Jennifer Welch Link Reversal Algorithms

  11. 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

  12. 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. Routing Example D 3 1 2 4 5 6

  14. 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. Mending Routes Example D 3 1 2 4 5 6

  16. 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… sink

  17. Full Reversal Routing Algorithm • 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

  18. D D D 3 1 2 2 1 3 3 2 1 4 5 4 6 5 6 5 4 6 D D D 3 2 1 3 2 1 1 2 3 4 5 6 4 5 6 4 5 6 Full Reversal (FR) Routing Example

  19. 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 g x and stays that way forever. • Then w cannot take any more steps, contradiction.

  20. 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. References Resource Allocation and Link Reversal • Dijkstra, E. W. (1971, June). Hierarchical ordering of sequential processes. ActaInformatica 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.

More Related