complexity of multi valued register simulations a

COMPLEXITY OF MULTI-VALUED REGISTER SIMULATIONS: A RETROSPECTIVE - PowerPoint PPT Presentation

COMPLEXITY OF MULTI-VALUED REGISTER SIMULATIONS: A RETROSPECTIVE Jennifer L. Welch Texas A&M University OPODIS December 2018 1 OPODIS 2018 Complexity of Multi-Valued Register Simulations The Problem Use a collection of shared


  1. COMPLEXITY OF MULTI-VALUED REGISTER SIMULATIONS: A RETROSPECTIVE Jennifer L. Welch Texas A&M University OPODIS December 2018

  2. 1 OPODIS 2018 Complexity of Multi-Valued Register Simulations The Problem • Use a collection of shared read-write registers with certain properties to simulate a shared read-write register with stronger properties in a wait-free manner

  3. 2 OPODIS 2018 Complexity of Multi-Valued Register Simulations Register Properties • consistency condition in presence of concurrent operations: • safe • regular • atomic • number of storable values • number of readers supported • number of writers supported

  4. 3 OPODIS 2018 Complexity of Multi-Valued Register Simulations Register Simulation write read 1. ... 1. ... WRITE 2. ... 2. ... 3. ... 3. ... READ read 4. ... 4. ... write 5. ... 5. ... write read

  5. 4 OPODIS 2018 Complexity of Multi-Valued Register Simulations Wait-Free • Each simulated operation terminates in a finite number of steps by invoking process regardless of behavior of other processes. • Other processes can be arbitrarily fast, or arbitrarily slow, or crash…

  6. 5 OPODIS 2018 Complexity of Multi-Valued Register Simulations Complexity Measures (Worst-Case) • Number of base • Number of steps by registers (M) READ algorithm (R) • Number of steps by WRITE algorithm (W) 1. public class HelloWorld { 2. public static void main(String[] args) { 3. System.out.println("Hello World!"); 4. } 5. }

  7. 6 OPODIS 2018 Complexity of Multi-Valued Register Simulations Background and Motivation: Multiprogramming Computers • Multi-programming environments developed in early 1970’s • Need to control/synchronize concurrent processes when accessing shared resources HP 3000. Photo credit: http://www.hpmuseum.net/exhibit.php?class=3&cat=32

  8. 7 OPODIS 2018 Complexity of Multi-Valued Register Simulations Background and Motivation: Readers/Writers Problem • [Courtois, Heymans, Parnas 1971]: motivated by 1960’s work on mutual exclusion but distinguish between readers and writers (“readers/writers problem”): • writers must have exclusive access to the resource • readers can share access to the resource Algorithms use semaphores to provide exclusive access • [Brinch Hansen 1972]: simplified one of the algorithms to use “conditional critical regions” instead of semaphores

  9. 8 OPODIS 2018 Complexity of Multi-Valued Register Simulations Background and Motivation: Avoid Mutual Exclusion • Drawbacks of using mutual exclusion for the readers/writers problem: • writer must wait until all current reads are done but what if writer has higher priority? • concurrent reading and writing may be needed to implement mutual exclusion • creates a serialization, decreasing parallelism • not fault-tolerant • [Lamport 1977]: Assumes hardware solves readers/writers problem for basic units of data and proposes algorithm for solving the problem for a composite data item • [Peterson 1983]: Improves on Lamport’s solution by not locking out readers and using bounded-size base units

  10. 9 OPODIS 2018 Complexity of Multi-Valued Register Simulations Background and Motivation: The Golden Age • [Lamport 1986]: Landmark 2-part paper on register simulations • formalized notions of safe, regular and atomic registers • proposed formal model • provided numerous algorithms • Initiated a spate of work to understand what kind of registers can be simulated out of what other kinds of registers

  11. 10 OPODIS 2018 Complexity of Multi-Valued Register Simulations Background and Motivation: Resurgence • Then a pause as community’s interest shifted to shared memory algorithms using stronger objects, such as T&S, F&A, CAS, etc.and to message-passing implementations of registers (“distributed storage”) • Recent papers have shown connections to register simulations, e.g.: • how to provide concurrent write ability to objects of any type, including those stronger than registers [Aghazadeh, Golab, Woelfel 2014] • lower bounds on space needed to share data in various distributed storage applications [Berger, Keidar, Spiegelman 2018] • Rekindled interest in register simulations

  12. 11 OPODIS 2018 Complexity of Multi-Valued Register Simulations Focus of This Talk: Binary Base Registers • Base registers are binary: can store one of two values (i.e., single bit) • Simulated register should store one of k > 2 values (i.e., multi-bit) • Simplification yet still gets at the heart of difficulties in simulating “large” registers using “small” registers • Literature includes generalizations for case when base registers can store b > 2 values and k > b • Assume k is a power of 2 and logs are base 2

  13. 12 OPODIS 2018 Complexity of Multi-Valued Register Simulations Focus of This Talk: Single-Writer Registers • Only one process can write each base register • Only one process can write the simulated register • Historically, safe and regular were only defined for single-writer registers • Even for atomic, most research on multi-valued simulations has been for single-writer registers

  14. 13 OPODIS 2018 Complexity of Multi-Valued Register Simulations Focus of This Talk: Only Change Number of Values • Consistency condition is the same for base registers as for simulated register • safe multi-valued out of safe binary • regular multi-valued out of regular binary • atomic multi-valued out of atomic binary • Number of readers is the same for base registers as for simulated register • Won’t cover numerous results for building regular out of safe, atomic out of regular, many-reader out of single- reader, etc.

  15. 14 OPODIS 2018 Complexity of Multi-Valued Register Simulations Image credit: http://coull.com/our-blog/coull-putting-brand-safety-first/

  16. 15 OPODIS 2018 Complexity of Multi-Valued Register Simulations Safe Register [Lamport 1986] • A read that does not overlap a write returns the value of the latest preceding write • A read that overlaps a write can return any value WRITE(1) WRITE(2) READ(y) READ(x) READ(1) • x and y can be anything (e.g., 3, 4, …)

  17. 16 OPODIS 2018 Complexity of Multi-Valued Register Simulations Binary Representation Algorithm [Lamport 1986] log k base registers LSB MSB READ: read 0, read 1, read 1, read 0, read 1 and RETURN(13) WRITE(19): write 1, write 0, write 0, write 1, write 1 LSB MSB

  18. 17 OPODIS 2018 Complexity of Multi-Valued Register Simulations Efficiency of Binary Representation Algorithm • M: log k base registers • optimal since k different values must be stored • R: log k steps by Reader • optimal since k different values must be read [Chaudhuri, Welch 1994] • W: log k steps by Writer • not optimal — see next algorithm…

  19. 18 OPODIS 2018 Complexity of Multi-Valued Register Simulations Hypercube Algorithm [Chaudhuri, Welch 1994] • based on coloring vertices of a (k−1)-dimensional hypercube with k colors • Example for k = 4: 110 111 010 011 100 101 000 001

  20. 19 OPODIS 2018 Complexity of Multi-Valued Register Simulations Hypercube Algorithm 110 111 [Chaudhuri, Welch 1994] 01 011 0 • each bit in the vertex labels is a base register 10 10 0 1 • M = k−1 00 00 • each vertex color is a value of the 0 1 simulated register: {R, G, B, Y} • READ: read all base registers, determine vertex in (3- dimensional) hypercube, and return color of vertex • R = k − 1 • WRITE(v): determine which base register to flip in order to go from current vertex to vertex with color v 1 • W = 1

  21. 20 OPODIS 2018 Complexity of Multi-Valued Register Simulations Independent Bounds for Safe Registers Complexity Measure Tight Value R (number of steps in READ alg) log k W (number of steps in WRITE alg) 1 M (number of base register) log k

  22. 21 OPODIS 2018 Complexity of Multi-Valued Register Simulations Safe Algorithms with Optimal Writes [Chaudhuri, Welch 1994] • Can we improve on hypercube algorithm while keeping W = 1? • No! • If W = 1, then R ≥ k−1. • If W = 1, then M ≥ k−1.

  23. 22 OPODIS 2018 Complexity of Multi-Valued Register Simulations Safe Algorithms with Optimal Registers [Chaudhuri, Welch 1994] • Can we improve on binary representation algorithm while keeping M = log k? • No! • If M = log k, then R ≥ log k. • If M = log k, then W ≥ log k.

  24. 23 OPODIS 2018 Complexity of Multi-Valued Register Simulations Safe Algorithms with Optimal Reads [Chaudhuri, Frank, Welch in prep] • Can we improve on binary representation algorithm while keeping R = log k? • No! • If R = log k, then W ≥ log k. • And M already has optimal value, log k

  25. 24 OPODIS 2018 Complexity of Multi-Valued Register Simulations Trade-Off Bounds for Safe Registers Optimal Other Tight Value Measure Measure R = log k W log k M log k “ W = 1 R k−1 M k−1 “ M = log k R log k W log k “

  26. 25 OPODIS 2018 Complexity of Multi-Valued Register Simulations Image credit: https://www.thetruthaboutcars.com/2008/06/in-defense-of-regular-gas/

Recommend


More recommend