The Space Complexity of Unbounded Timestamps!

Similar documents
Valency Arguments CHAPTER7

Consensus and Universal Construction"

Atomic m-register operations

Lower Bounds for Restricted-Use Objects

Distributed Computing in Shared Memory and Networks

An O(sqrt(n)) space bound for obstruction-free leader election

Can an Operation Both Update the State and Return a Meaningful Value in the Asynchronous PRAM Model?

Lower Bound on the Step Complexity of Anonymous Binary Consensus

Combining Shared Coin Algorithms

Concurrent Timestamping Made Simple. March 3, Abstract. Concurrent Time-stamp Systems (ctss) allow processes to temporally order concurrent

Lower Bounds for Restricted-Use Objects

LOWER BOUNDS FOR RANDOMIZED CONSENSUS UNDER A WEAK ADVERSARY

Sub-Logarithmic Test-and-Set Against a Weak Adversary

Properties of the Integers

a + b = b + a and a b = b a. (a + b) + c = a + (b + c) and (a b) c = a (b c). a (b + c) = a b + a c and (a + b) c = a c + b c.

Simultaneous Consensus Tasks: A Tighter Characterization of Set-Consensus

Nontrivial and Universal Helping for Wait-Free Queues and Stacks

Section 6 Fault-Tolerant Consensus

Atomic snapshots in O(log 3 n) steps using randomized helping

Theoretical Computer Science

CISC 876: Kolmogorov Complexity

Some Combinatorial Aspects of Time-Stamp Systems. Unite associee C.N.R.S , cours de la Liberation F TALENCE.

Fault-Tolerant Consensus

Allocate-On-Use Space Complexity of Shared-Memory Algorithms

A Brief Introduction to Model Checking

On the weakest failure detector ever

A modular approach to shared-memory consensus, with applications to the probabilistic-write model

Communication-Efficient Randomized Consensus

On the weakest failure detector ever

Lower Bounds on the Amortized Time Complexity of Shared Objects

Information-Theoretic Lower Bounds on the Storage Cost of Shared Memory Emulation

Colorless Wait-Free Computation

Randomized Protocols for Asynchronous Consensus

The Bakery Algorithm: Yet Another Specification and Verification 0

Complexity Tradeoffs for Read and Update Operations

Math 324 Summer 2012 Elementary Number Theory Notes on Mathematical Induction

Problem set 1, Real Analysis I, Spring, 2015.

MATH 324 Summer 2011 Elementary Number Theory. Notes on Mathematical Induction. Recall the following axiom for the set of integers.

A Theory of Competitive Analysis for Distributed Algorithms

Lower Bounds for Distributed Coin-Flipping and Randomized Consensus. James Aspnes

Space Complexity. The space complexity of a program is how much memory it uses.

A Time Complexity Lower Bound for Randomized Implementations of Some Shared Objects (Preliminary Version)

Distributed Consensus

HW2 Solutions Problem 1: 2.22 Find the sign and inverse of the permutation shown in the book (and below).

Weakening Failure Detectors for k-set Agreement via the Partition Approach

1 Lamport s Bakery Algorithm

Efficient Algorithms for Checking the Atomicity of a Run of Read and Write Operations

Time. Today. l Physical clocks l Logical clocks

2.2 Some Consequences of the Completeness Axiom

arxiv: v1 [cs.dc] 9 Feb 2015

Time. To do. q Physical clocks q Logical clocks

On the Complexity of Synchronization. Rati Gelashvili

6.852: Distributed Algorithms Fall, Class 24

Unreliable Failure Detectors for Reliable Distributed Systems

Distributed Algorithms

Dartmouth Computer Science Technical Report TR Efficient Wait-Free Implementation of Multiword LL/SC Variables

Fundamentals of Pure Mathematics - Problem Sheet

Randomized naming using wait-free shared variables

The Las-Vegas Processor Identity Problem (How and When to Be Unique)

Harvard CS 121 and CSCI E-207 Lecture 6: Regular Languages and Countability

Part I: Definitions and Properties

Standard Diraphs the (unique) digraph with no vertices or edges. (modulo n) for every 1 i n A digraph whose underlying graph is a complete graph.

arxiv: v1 [cs.dc] 2 Jul 2015

DEXON Consensus Algorithm

CSE 1400 Applied Discrete Mathematics Proofs

A Universal Turing Machine

not to be republished NCERT REAL NUMBERS CHAPTER 1 (A) Main Concepts and Results

Shared Memory vs Message Passing

The Extended BG-Simulation and the Characterization of t-resiliency

Chapter 1 The Real Numbers

Ring Sums, Bridges and Fundamental Sets

Are Lock-Free Concurrent Algorithms Practically Wait-Free?

Homework 7 Solutions, Math 55

5 Set Operations, Functions, and Counting

Algorithms: Background

NAME: Mathematics 205A, Fall 2008, Final Examination. Answer Key

Complexity Theory VU , SS The Polynomial Hierarchy. Reinhard Pichler

Outline. Complexity Theory EXACT TSP. The Class DP. Definition. Problem EXACT TSP. Complexity of EXACT TSP. Proposition VU 181.

Implementing Uniform Reliable Broadcast with Binary Consensus in Systems with Fair-Lossy Links

Conditions on Input Vectors for Consensus Solvability in Asynchronous Distributed Systems

Impossibility and Feasibility Results for Zero Knowledge with Public Keys

Solutions to Assignment 1

On the time and space complexity of randomized test-and-set

Verifying Concurrent Programs

Section Summary. Proof by Cases Existence Proofs

The assertional versus Tarskian methods

Concurrent Counting is Harder than Queuing

Solution Set 2. Problem 1. [a] + [b] = [a + b] = [b + a] = [b] + [a] ([a] + [b]) + [c] = [a + b] + [c] = [a + b + c] = [a] + [b + c] = [a] + ([b + c])

MAD. Models & Algorithms for Distributed systems -- 2/5 -- download slides at

Four Basic Sets. Divisors

MATH 202B - Problem Set 5

Analysis III. Exam 1

Register machines L2 18

Separating the Power of EREW and CREW PRAMs with Small Communication Width*

A Level. A Level Mathematics. Proof by Contradiction (Answers) AQA, Edexcel, OCR. Name: Total Marks:

Reading the Linearizability paper of Herlihy and Wing

Self-Stabilizing Silent Disjunction in an Anonymous Network

CSE 20 DISCRETE MATH. Winter

Distributed Algorithms (CAS 769) Dr. Borzoo Bonakdarpour

Observation 4.1 G has a proper separation of order 0 if and only if G is disconnected.

Transcription:

The Space Complexity of Unbounded Timestamps! Faith Ellen, University of Toronto! Panagiota Fatourou, University of Ioannina! Eric Ruppert, York University!

Timestamp System! a set of timestamps U! two operations:! GetTS() returns a timestamp! Compare(t,t ) returns a Boolean value, " indicating which of the timestamps! " t or t was generated first!

Timestamps have been used to:! solve mutual exclusion! solve randomized consensus! construct multi-writer registers " " " from single-writer registers! construct snapshot objects and "" " other data structures!

A very simple timestamp system! 0! counter! C! U = N! GetTS():! t Fetch&Increment(C)! return (t)! Compare(t,t ):! return (t < t )!

Timestamps can grow without bound during an execution.! This is necessary to describe the ordering among an unbounded number of non-concurrent events.! For some applications, Compare is restricted to recent events, so old timestamps can be reused.!

A timestamp system is:! unbounded, if U is infinite, and! bounded, if U is finite.! Bounded Timestamp Systems:! Dolev and Shavit [1997], Dwork and Waarts [1999], Dwork, Herlihy, Plotkin, and Waarts [1999], Haldar and Vitanyi [2002], Israeli and Li [1993], Israeli and Pinhasov [1992]!

Theorem [Israeli and Li] Any bounded timestamp system shared by n processes must use (n) bits per timestamp.! Unbounded timestamps can have length logarithmic in the number of GetTS operations performed.! If the number GetTS operations is reasonable, for example less than 2 64, then timestamps can fit in a single memory word.!

A simple timestamp system using single-writer registers! [Lamport, 1974]! 0! 0! 0! 0! 0! 0! U = N! R 1! R 2! R 3! R 4! R n! GetTS() by process p i :! t 1 + max{r 1,...,R n }! R i write(t)! return (t)! Compare(t,t ):! return (t < t )!

If some GetTS operation returns t and! another GetTS, which starts after it! is complete, returns t,! then Compare(t,t ) = 1.! To ensure that timestamps obtained by! different GetTS operations in an execution! are different, append the log n bit! process ID to the result.!

A simple timestamp system using single-writer registers! [Dwork and Waarts, 1999]! 0! 0! 0! 0! 0! 0! U = N n! R 1! R 2! R 3! R 4! R n! GetTS() by process p i :! R i write(1+r i )! t read(r 1,...,R n )! return (t)! each timestamp! is a vector of n! integers!

Compare(t,t ) can be done! lexicographically or! t < t if there exists k such that! t i = t i for i < k and t k < t k! component-wise! t < t if t i t i for i = 1,..,k and there exists k such that t k < t k!

Both these timestamp implementations use n shared registers.! Is it possible to implement an unbounded timestamp system using fewer registers?!

Model! n deterministic asynchronous processes, p 1,, p n! r shared registers, R 1,, R r! obstruction free: each GetTS and Compare operation must complete if it is given sufficiently many consecutive steps.!

Theorem Every single-writer timestamp implementation for n processes uses at least n-1 registers.! Proof Let α i be the solo execution of GetTS by process p i starting from C. 0 To obtain a contradiction, suppose there exist p i and p j that perform no writes during α i and α j, respectively.!

α j! C 0! α i! α j! GetTS in α i returns t i! α i! C! Compare(t i, t j )! by q p i,p j!

Theorem Every timestamp implementation for n processes uses more than n-1 / 2 registers.!

Covering Argument! A process p i covers a register R j in a configuration if p i will write to R j when it next takes a step.! A set P of k processes covers a set R of k registers if each register in R is covered by some process in P.! If P covers R, a block write by P consists of a consecutive sequence of writes, one by each process in P.!

Suppose that, in configuration C, P 1,P 2,Q each cover the set of registers R; P 1,P 2,Q are disjoint; S 1,S 2 are disjoint; S 1, (P 2 Q) are disjoint; and S 2,(P 1 Q) are disjoint.! S 1! S 2! P 1! Q! P 2!

Lemma Suppose that, in configuration C, P 1,P 2,Q each cover the set of registers R; P 1,P 2,Q are disjoint; S 1,S 2 are disjoint; S 1, (P 2 Q) are disjoint; and S 2,(P 1 Q) are disjoint.! Let β 1, β 2 be block writes by P 1,P 2.! Then, for some i {1,2}, all S i -only executions α i starting from Cβ i containing a complete GetTS contain a write to a register not in R.!

Proof Suppose not. Then α i,β i only write to R.! β 2! C! β 1! α 1! β 2! GetTS in α i returns t i! γ block write to R by Q! α 2! α 2! β 1! α 1! γ! γ! C! Compare(t 1, t 2 )! by q S 1 S 2!

Theorem Every timestamp implementation for n processes uses more than n-1 / 2 registers.! Proof Suppose there is an implementation using r n-1 / 2 registers. Then, for k=1,,r, there is a configuration in which k registers are each covered by r-k+3 processes (by induction, using the lemma). When k=r, apply the lemma again. This is a CONTRADICTION since no more registers exist.!

Base Case: k = 1! By the lemma with R = φ, for every process p i, except possibly one,! C 0! solo GetTS by p i! δ i! write to R σ(i)! no writes in δ i! C 0!! δ 1! δ 2! δ 3! δ n! At least n-1 > r(r+1) processes covering r registers some register is covered by at least r+2 = r - k +3 processes.! C!

Induction Step:! Consider a configuration C with P 1,,P r-k+3 disjoint sets of processes each covers R, a set of k registers! P 1! P 2! P 3! P r-k+3! other processes!

Induction Step:! Consider a configuration C with P 1,,P r-k+3 disjoint sets of processes each covers R, a set of k registers! P 1! P 2! P 3! P r-k+3! Q S 1! S 2! other processes!

By the lemma, for some i {1,2}, every S i -only execution starting from Cβ i containing a complete GetTS contains a write to a register not in R.! Cβ i! δ 1 δ h! δ 1,,δ h solo executions by h different processes in S i that only write to R.! At Cβ i δ 1 δ h these processes cover registers not in R.!

By the lemma, for some i {1,2}, every S i -only execution starting from Cβ i containing a complete GetTS contains a write to a register not in R.! Cβ i! solo GetTS by another process in S i! δ 1 δ h! α! δ 1,,δ h solo executions by h different processes in S i that only write to R.! At Cβ i δ 1 δ h these processes cover registers not in R.!

By the lemma, for some i {1,2}, every S i -only execution starting from Cβ i containing a complete GetTS contains a write to a register not in R.! Cβ i! solo GetTS by another process in S i! δ 1 δ h! write not to R! δ 1,,δ h solo executions by h different processes in S i that only write to R.! At Cβ i δ 1 δ h these processes cover registers not in R.!

By the lemma, for some i {1,2}, every S i -only execution starting from Cβ i containing a complete GetTS contains a write to a register not in R.! Cβ i! solo GetTS by another process in S i! δ 1 δ h! write not to R! δ h+1! δ 1,,δ h solo executions by h different processes in S i that only write to R.! At Cβ i δ 1 δ h these processes cover registers not in R.!

By the lemma, for some i {1,2}, every S i -only execution starting from Cβ i containing a complete GetTS contains a write to a register not in R.! Cβ i! δ 1 δ h! δ h+1! δ 1,,δ h,δ h+1 solo executions by h+1 different processes in S i that only write to R.! At Cβ i δ 1 δ h δ h+1 these processes cover registers not in R.!

Cβ i! δ! δ solo executions by all processes in S i that only write to R.! At Cβ i δ these processes cover registers not in R.! By a simple counting argument, at Cβ i δ some register R j R is covered by at least r-k+2 processes.! All registers in R are covered by r-k+2 = r-(k+1) + 3 processes.!

For k=1,,r, there is a configuration in which k registers are each covered by r-k+3 processes.! Theorem Every timestamp implementation for n processes uses more than n-1 / 2 registers.!

U partially ordered universe under <! Compare(t 1,t 2 ) = 1 if and only if t 1 < t 2! U is nowhere dense if for all x,y U, there are only a finite number of elements z U such that x < z < y.! Examples! integers under <! set of all finite sets of integers under!

Another Example! set of length k vectors of integers ordered component-wise:! (u 1,,u k ) (v 1,,v k ) if and only if u i v i for i = 1,,k.! Between (1,2,1,3) and (1,4,2,3) there are: (1,2,2,3), (1,3,1,3), (1,3,2,3), (1,4,1,3)!

Not an Example! -Rational numbers! -set of length k vectors of integers ordered lexicographically.! Between (1,0) and (2,0) there are an infinite number of elements: (1,1), (1,2), (1,3), (1,4),!

Theorem Every timestamp implementation for n processes that uses a nowhere dense universe requires at least n registers.! Proof: For k=0,,n, there is a configuration in which k registers are covered.! Base Case: The initial configuration.!

Induction Step:! Consider a configuration C where a set R of k < n registers is covered by a set of k processes P.! GetTS by q returns t 1! GetTS by q returns t 2! :! C! β! α! block write to R! GetTS by p returns t! q P {p}!

GetTS by q returns t 1! GetTS by q returns t 2! :! t 1 < t 2 <! C! β! α! block write to R! q P {p}! GetTS by p returns t! There exists t j such that t j < t is false; otherwise there are infinitely many elements of U between t 1 and t.!

GetTS by q returns t 1! GetTS by q returns t j! C! :! β! α! block write to R! GetTS by p returns t! q P {p}! t j < t is false! β! α! If q writes only to registers in R!

δ! q writes to R h R! C! β! block write to R! q P {p}! In configuration Cδ, a set R {R h } of k+1 registers is covered by a set of k +1 processes P {q}.!

By induction, there is a configuration in which all n registers are covered.! Theorem Every timestamp implementation for n processes that uses a nowhere dense universe requires at least n registers.!

Theorem There is a wait-free timestamp implementation that uses n-1 single-writer registers.! U = N N, ordered lexicographically! GetTS() by process p i, i < n:! t 1 + max{r 1,...,R n-1 }! R i write(t)! return (t,0)!

GetTS() by process p i, i < n:! t 1 + max{r 1,...,R n-1 }! R i write(t)! return (t,0)! GetTS() by process p n :! t max{r 1,...,R n-1 }! if t > oldt then c 0! c c + 1! oldt t! return (t,c)!

GetTS() by process p i, i < n:! t 1 + max{r 1,...,R n-1 }! R i write(t)! return (t,0)! GetTS() by process p n :! t max{r 1,...,R n-1 }! if t > oldt then c 0! c c + 1! oldt t! return (t,c)! if GetTS returns (t,c) and then another GetTS begins and returns (t,c ), then (t,c) < (t,c )!

Theorem Every timestamp implementation for n processes uses more than n-1 / 2 registers.! Theorem Every timestamp implementation for n processes that uses a nowhere dense universe requires at least n registers.! Theorem There is a timestamp implementation for n processes that uses n-1 single-writer registers and no such implementation uses fewer registers.!

Open Problem! What is the minimum number of registers needed to implement a timestamp system?! If there is a system that uses fewer than n-1 registers, it must use some multi-writer registers and a universe that is NOT nowhere dense.!