Atomic snapshots in O(log n) steps using randomized helping James Aspnes, Yale Keren Censor-Hillel,...
-
Upload
neil-willis -
Category
Documents
-
view
216 -
download
0
description
Transcript of Atomic snapshots in O(log n) steps using randomized helping James Aspnes, Yale Keren Censor-Hillel,...
![Page 1: Atomic snapshots in O(log n) steps using randomized helping James Aspnes, Yale Keren Censor-Hillel, Technion 1.](https://reader036.fdocuments.net/reader036/viewer/2022082622/5a4d1b917f8b9ab0599c1043/html5/thumbnails/1.jpg)
1
Atomic snapshots in O(log³ n) steps using randomized helping
James Aspnes, YaleKeren Censor-Hillel, Technion
![Page 2: Atomic snapshots in O(log n) steps using randomized helping James Aspnes, Yale Keren Censor-Hillel, Technion 1.](https://reader036.fdocuments.net/reader036/viewer/2022082622/5a4d1b917f8b9ab0599c1043/html5/thumbnails/2.jpg)
Snapshot Objects
p1 p2 pn…
…
update(v) scan
2
update your location
read all locations
![Page 3: Atomic snapshots in O(log n) steps using randomized helping James Aspnes, Yale Keren Censor-Hillel, Technion 1.](https://reader036.fdocuments.net/reader036/viewer/2022082622/5a4d1b917f8b9ab0599c1043/html5/thumbnails/3.jpg)
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
![Page 4: Atomic snapshots in O(log n) steps using randomized helping James Aspnes, Yale Keren Censor-Hillel, Technion 1.](https://reader036.fdocuments.net/reader036/viewer/2022082622/5a4d1b917f8b9ab0599c1043/html5/thumbnails/4.jpg)
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)
![Page 5: Atomic snapshots in O(log n) steps using randomized helping James Aspnes, Yale Keren Censor-Hillel, Technion 1.](https://reader036.fdocuments.net/reader036/viewer/2022082622/5a4d1b917f8b9ab0599c1043/html5/thumbnails/5.jpg)
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?
![Page 6: Atomic snapshots in O(log n) steps using randomized helping James Aspnes, Yale Keren Censor-Hillel, Technion 1.](https://reader036.fdocuments.net/reader036/viewer/2022082622/5a4d1b917f8b9ab0599c1043/html5/thumbnails/6.jpg)
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
![Page 7: Atomic snapshots in O(log n) steps using randomized helping James Aspnes, Yale Keren Censor-Hillel, Technion 1.](https://reader036.fdocuments.net/reader036/viewer/2022082622/5a4d1b917f8b9ab0599c1043/html5/thumbnails/7.jpg)
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]
![Page 8: Atomic snapshots in O(log n) steps using randomized helping James Aspnes, Yale Keren Censor-Hillel, Technion 1.](https://reader036.fdocuments.net/reader036/viewer/2022082622/5a4d1b917f8b9ab0599c1043/html5/thumbnails/8.jpg)
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
![Page 9: Atomic snapshots in O(log n) steps using randomized helping James Aspnes, Yale Keren Censor-Hillel, Technion 1.](https://reader036.fdocuments.net/reader036/viewer/2022082622/5a4d1b917f8b9ab0599c1043/html5/thumbnails/9.jpg)
9
Max-Registerswitch = 0
switch = 0 switch = 0
value 0 value 1
value v value v’
… ……
write(v)
switch = 1 read
![Page 10: Atomic snapshots in O(log n) steps using randomized helping James Aspnes, Yale Keren Censor-Hillel, Technion 1.](https://reader036.fdocuments.net/reader036/viewer/2022082622/5a4d1b917f8b9ab0599c1043/html5/thumbnails/10.jpg)
10
Max-Registerswitch = 0
switch = 0 switch = 0
value 0 value 1
value v value v’
… ……
write(v)
switch = 1 read
write(v’)
switch = 1
write(v’’)
![Page 11: Atomic snapshots in O(log n) steps using randomized helping James Aspnes, Yale Keren Censor-Hillel, Technion 1.](https://reader036.fdocuments.net/reader036/viewer/2022082622/5a4d1b917f8b9ab0599c1043/html5/thumbnails/11.jpg)
11
Randomized Max-Registerswitch = 0
switch = 0
switch = 0
…
…
write(v)
switch = 1
switch = 1
m-valued max register
![Page 12: Atomic snapshots in O(log n) steps using randomized helping James Aspnes, Yale Keren Censor-Hillel, Technion 1.](https://reader036.fdocuments.net/reader036/viewer/2022082622/5a4d1b917f8b9ab0599c1043/html5/thumbnails/12.jpg)
12
Randomized Max-Registerswitch = 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
![Page 13: Atomic snapshots in O(log n) steps using randomized helping James Aspnes, Yale Keren Censor-Hillel, Technion 1.](https://reader036.fdocuments.net/reader036/viewer/2022082622/5a4d1b917f8b9ab0599c1043/html5/thumbnails/13.jpg)
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)
![Page 14: Atomic snapshots in O(log n) steps using randomized helping James Aspnes, Yale Keren Censor-Hillel, Technion 1.](https://reader036.fdocuments.net/reader036/viewer/2022082622/5a4d1b917f8b9ab0599c1043/html5/thumbnails/14.jpg)
14
Reading the Max-Register
0
…
…
read
1
1…TS:
…HELP:
…POINTER:
readpi
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
![Page 15: Atomic snapshots in O(log n) steps using randomized helping James Aspnes, Yale Keren Censor-Hillel, Technion 1.](https://reader036.fdocuments.net/reader036/viewer/2022082622/5a4d1b917f8b9ab0599c1043/html5/thumbnails/15.jpg)
15
2-Component Max Array
write0(v)
read
update first max-register
read both max-registers
write1(v)update second max-register
![Page 16: Atomic snapshots in O(log n) steps using randomized helping James Aspnes, Yale Keren Censor-Hillel, Technion 1.](https://reader036.fdocuments.net/reader036/viewer/2022082622/5a4d1b917f8b9ab0599c1043/html5/thumbnails/16.jpg)
16
Max Array Implementationswitch = 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
![Page 17: Atomic snapshots in O(log n) steps using randomized helping James Aspnes, Yale Keren Censor-Hillel, Technion 1.](https://reader036.fdocuments.net/reader036/viewer/2022082622/5a4d1b917f8b9ab0599c1043/html5/thumbnails/17.jpg)
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
![Page 18: Atomic snapshots in O(log n) steps using randomized helping James Aspnes, Yale Keren Censor-Hillel, Technion 1.](https://reader036.fdocuments.net/reader036/viewer/2022082622/5a4d1b917f8b9ab0599c1043/html5/thumbnails/18.jpg)
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?