atomic snapshots in o (log³ n) steps using randomized helping

Post on 04-Jan-2016

32 Views

Category:

Documents

2 Downloads

Preview:

Click to see full reader

DESCRIPTION

Atomic snapshots in O (log³ n) steps using randomized helping. James Aspnes , Yale Keren Censor-Hillel, Technion. Snapshot Objects. …. update( v ). scan. r ead all locations. update your location. p 1. p 2. p n. …. Model. R 1. R 2. R. …. read. v. write( v ). ok. p 1. p 2. - PowerPoint PPT Presentation

TRANSCRIPT

1

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

James Aspnes, YaleKeren Censor-Hillel, Technion

Snapshot Objects

p1 p2 pn…

update(v) scan

2

update your location

read all locations

3

Model

System of n processes, multi-writer registersAsynchronous schedule controlled by an adversaryCrash failures – require wait-free implementationsLinearizable implementations

p1 p2

R1

pn

R2 R…

read v write(v) ok

4

Snapshots - Step ComplexityUsing multi-writer registers:

can be done in O(n) steps [Inoue and Chen, WDAG 1994]

and requires Ω(n) steps [Jayanti, Tan, and Toueg, SICOMP 1996]

Goal: a faster snapshot implementation (polylog)

Limited-use: O(log3(n)) steps per operation, for polynomially many update operations [Aspnes, Attiya, Censor-Hillel, and Ellen, PODC 2012]

This Talk: O(log3(n)) steps per operation, with high probability(without a usage bound)

5

Pointer to array location

s1 s2 s3 s4

s1+s2 s3+s4

s1+...+s4

0

Tree structure, Updates help Scans

0 01 1

12

2 2

3

3

45

Array of views

5X

[Aspnes, Attiya, Censor-Hillel, and Ellen, PODC 2012] O(log n)

steps?

6

Two Challenges

s1 s2 s3 s4

s1+s2 s3+s4

s1+...+s4

5

1. Coping with slow operations. Max-register: returns largest

value previously written [Aspnes, Attiya, and

Censor-Hillel, JACM 2012]

Consecutive values differ by

at most n

7

Two Challenges

s1 s2 s3 s4

s1+s2 s3+s4

s1+...+s4

5

2. Guaranteeing consistent views. Max-array: returns comparable

pairs of max-register values [Aspnes, Attiya, Censor-Hillel, and Ellen,

PODC 2012]

8

Our Results

Randomized max-register in O(logn) steps with high probability

Randomized 2-component max-arrayO(log2n) steps whp

Randomized snapshot in O(log3n) steps whp

Main technique: randomized helping

9

Max-Register

switch = 0

switch = 0 switch = 0

value 0 value 1

value v value v’

… ……

write(v)

switch = 1 read

10

Max-Register

switch = 0

switch = 0 switch = 0

value 0 value 1

value v value v’

… ……

write(v)

switch = 1 read

write(v’)

switch = 1

write(v’’)

11

Randomized Max-Register

switch = 0

switch = 0

switch = 0

write(v)

switch = 1

switch = 1

m-valued max register

12

Randomized Max-Register

switch = 0

switch = 0

switch = 0

write(v)

switch = 1

switch = 1k-bounded increments:

value of write ≤ k + value of largest write

m-valued max register

O(log m + kn/m) = O(log n) steps per write

13

Writing to the Max-Register

0

write(v)

1

1…TS:

…HELP:

…POINTER:

write(v)pi

v', ts[j]TS[j]

pj (cyclic)

i

read

(random)

size n3

read v’ = max(returned value, v)

14

Reading the Max-Register

0

read

1

1…TS:

…HELP:

…POINTER:

read

pi

read (returns v, ts[j])

pj

read (returns i)

+1

(random)

size n3

(logarithmic no. of steps)

if ts[j]==TS[j] return v

Main argument:many read steps

many fresh values in pointer array, whp

15

2-Component Max Array

write0(v)

read

update first max-register

read both max-registers

write1(v)update second max-register

16

Max Array Implementation

switch = 0

switch = 0 switch = 0

value 0 value 1

value v value v’

… ……

write0(v)

readMax1

Max1 Max1

Max1 Max1

Max1 Max1

write1(v) Max1

Max1

Max1

17

Randomized 2-Component Max Array

switch = 0

switch = 0

switch = 0

write(v)

switch = 1

switch = 1 Max1

Max1Max1

Max1

Max1 Max1

Max1

Max1

Max1

Problem: readers do not travel all the way

from root to valueMax1

Max1Max1

Solution: read Max at root instead of Max at

previous location

18

Summary

Randomized snapshot in O(log3n) steps whp

Main Technique: Randomized helping

Open problems:– Snapshot implementations using single-writer registers– Additional randomized implementations– Randomized lower bounds

Thank you! Questions?

top related