1 / 30

An Space Bound for Obstruction-Free Leader Election

An Space Bound for Obstruction-Free Leader Election. George Giakkoupis , Maryam Helmi , Lisa Higham and Philipp Woelfel DISC 2013. Leader Election. Shared memory with n processors. Atomic multi writer snapshot object. Each process has to decide on one value, win or lose.

syshe
Télécharger la présentation

An Space Bound for Obstruction-Free Leader Election

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. An Space Bound for Obstruction-Free Leader Election George Giakkoupis, Maryam Helmi, Lisa Higham and Philipp Woelfel DISC 2013

  2. Leader Election • Shared memory with n processors. • Atomic multi writer snapshot object. • Each process has to decide on one value, win or lose. • Exactly one process (the leader) wins: • At least one process wins • At most one process wins • Wait free leader election cannot be solved using only read write registers

  3. Obstruction-Freedom • A deterministic algorithm is obstruction-free, if it guarantees that any process will finish if it performs enough steps alone. • Obstruction free step complexity- the maximum number of steps until a process taking steps alone finishes.

  4. Obstruction Free Leader Election • Shared array of registers. • The algorithms proceeds in phases, in each phase a process writes to • Each registers in contains a pair of process id and phase number, initialized to zero. Process id Phase # (0,0) (0,0) (0,0) (0,0) (0,0) (0,0) (0,0) (0,0)

  5. Obstruction Free Leader Election Code for process Phase # Double collect until equal 1 While m do r[0..m] = R.scan() if lose else if (#entries with ( and #entries ) lose else if r[0…] = [(p,),…,(p,)] else Let be the smallest : r[i](p,) R[i](p,) End Win (p,2) (p,1) (0,0) (0,0) (p,1) (p,2) (p,2) (0,0) (0,0) (0,0) (0,0) (0,0) (0,0)

  6. Not Wait Free If 2 processes alternate in executing the while loop they never finish the 1st phase 1 While m do r[0..m] = R.scan() if lose else if (#entries with ( and #entries ) lose else if r[0…] = [(p,),…,(p,)] else Let be the smallest : r[i](p,) R[i](p,) End Win (1,1) (1,1) (0,0) (2,1) (2,1) (0,0) (0,0) (0,0) (0,0) (0,0) (0,0) (0,0)

  7. Obstruction Free Leader Election 1 While m do r[0..m] = R.scan() if lose else if (#entries with ( and #entries ) lose else if r[0…] = [(p,),…,(p,)] else Let be the smallest : r[i](p,) R[i](p,) End Win Obstruction Free Step Complexity: For each phase at most scan operations, each scan with step complexity .

  8. Not All Processes Lose • Lemma 1: Not all processes lose. • If all processes lose, let be the last phase. (q,) (---,---) (q,) (p,) (---,---) (---,---) The last scan of that caused to lose Last scan of phase , by #entries of Contradiction to the scan of Contradiction to . lost thus, the purple conditionmust hold after the scan lost thus, the orange or purple conditionmust hold after the scan

  9. Obstruction Free Leader Election Observation 1: Only processes in phase write to 1 While m do r[0..m] = R.scan() if lose else if (#entries with ( and #entries ) lose else if r[0…] = [(p,),…,(p,)] else Let be the smallest : r[i](p,) R[i](p,) End Win Observation 2: If two processes got to phase ( got to phase first), than entries of where written by different processes before the next scan of

  10. Only one wins • the set of processes that participate in phase

  11. Only one wins Lemma 3: Lemma 2:

  12. Lemma 2: Let be the first process that got to phase At least 2 entries remain equal to , and any process that scan must lose All entries equal Each process write to at most once before the scan of , at most processes can write to () () () () () () () (---,---)

  13. Lemma 3: • Easy warm up case: • Suppose:

  14. Lemma 3: The last processes entered phase processes entered phase The first extra process entered phase The th extra process entered phase The th extra process entered phase

  15. Lemma 3: At most one entry with before the scan by The th extra process entered phase The th extra process entered phase Only processes in phase equal processes from smaller phases write to () () () () () () (0,0) () These processes will lose after the write

  16. Lemma 3: The last processes entered phase -1 processes at phase<lost -2 processes at phase<lost … processes entered phase At least processes will lose in the time interval The first extra process entered phase The th extra process entered phase The th extra process entered phase

  17. Lemma 3: At least processes will lose in the time interval Time intervals of different phases do not overlap The total number of processes that will lose is at least

  18. Lemma 3:

  19. Lemma 3:

  20. Lemma 3: . . .

  21. Wrap Up: Only one wins Lemma 3: Lemma 2:

  22. Optimization: Early Termination • exits the while loop if: • The green condition is satisfied • did not see any other process during phases and . • Applying this condition, a process finishes after solo steps.

  23. Deterministic to Randomized • Preserve space complexity Deterministic obstruction-free algorithm Randomized wait-free algorithm

  24. Randomized Model • Processes can use local coin-flips to make random decisions. • The scheduling and process crashes are controlled by an oblivious adversary, which determines the entire (infinite) schedule ahead of time.

  25. Randomized Wait-free • A deterministic algorithm is wait-free if every process finishes in an finite number of its own steps. • A randomized algorithm is randomized wait-free if every process finishes in an expected finite number of steps.

  26. Deterministic to Randomized • Preserve space complexity Deterministic obstruction-free algorithm Randomized wait-free algorithm (oblivious adversary) Any process finishes after executing at most b steps without interference Any process finishes w.h.p. after O(b(n+b)logn) steps

  27. Transformation Technique • Flip a coin in the beginning and after every b steps. • Each coin flip returns heads with probability , independently. Execute the next b steps of the given deterministic algorithm Execute b dummy steps

  28. Rough Transformation Analysis • Fix the schedule • Order the processes by the order in which they take their real step. • Look at process , and define disjoint blocks: Heads real steps of ,steps of other process, number of coin flips in the block

  29. Rough Transformation Analysis • number of coin flips in the block • At most coin flip outside the block effect the block • Unobstructed block contains real steps only by • The probability of a block to be unobstructed is

  30. To Sum Up • We saw a deterministic obstruction-free implementation of leader election using registers. • We saw a technique to transform any deterministic obstruction free algorithm into a randomized wait free algorithm for the oblivious adversary.

More Related