Implementing Snapshot Objects
- n Top of Crash-Prone
Asynchronous Message-Passing Systems
Carole Delporte-Gallet, Hugues Fauconnier, Sergio Rajsbaum, Michel Raynal
1
Implementing Snapshot Objects on Top of Crash-Prone Asynchronous - - PowerPoint PPT Presentation
Implementing Snapshot Objects on Top of Crash-Prone Asynchronous Message-Passing Systems Carole Delporte-Gallet, Hugues Fauconnier, Sergio Rajsbaum, Michel Raynal 1 Processes communicate by applying operations on and receiving response
Carole Delporte-Gallet, Hugues Fauconnier, Sergio Rajsbaum, Michel Raynal
1
and receiving response from shared objects
2
return y {state = y}write(x){state = x} {state = y}read(){state = y} return ok
3
4
read() write(y) write(x)
x
5
message passing
P1 P2 write(2) write(1) write(0) read()
6
write1(1)write2(2)ok1write1(0)ok2ok1read2()02
7
P1 P2 write(2) write(1) write(0) read()
7
P3
P1 P2 write(2) write(1) write(0) read()
8
P1 P2 write(2) write(1) write(0) read()
9
10
written by Pi
11
P0 P1 update(1) update(2) snapshot() snapshot() [ , ,….] [1,2,…..] ⊥ ⊥
12
P0 P1 update(1) Update(2) snapshot snapshot [ , ,…..] [1,2,…..] snapshot [1, , …. ]
⊥
⊥ ⊥
13
Si ⊆ SjorSj ⊆ Si
14
initially shared R array of atomic register init [v,…v] local to Pi array C of n items init [v,…v] Code of Pi update(w){ R.[i]write(w) return (ok) } snapshot(){ for ( int j=0; j<n; j++) C[i]:=R[i].read() return C }
15
P0 P1 update(1) Update(2) snapshot 1 2 [ ,2,….] ⊥
16
initially shared R array of atomic register init [v,…v] local to Pi array C of n items init [v,…v] Code of Pi update(w){ R.[i]write(w) return (ok) } collect(){ for ( int j=0; j<n; j++) C[i]:=R[i].read() return C }
17
18
collect collect C1 C2
19
initially shared R array of atomic register init [v,…v] local to Pi array C1,C2 of n items init [v,…v] Code of Pi update(w){ R[i].write(w) return (ok) } collect(){ for ( int j=0; j<n; j++) C[i]:=R[i].read() return C } snapshot(){ C1:=collect() forever C2:=collect (); if (C1==C2) return C1 else C1:=C2 }
20
collect collect C1 C2 C1==C2 snapshot C1 update
21
terminate
22
sufficient
23
24
end of write? what happen if only some process receive (write, x)? write(x) and write(y), what is the latest ?
(ok_write,ts)from a majority of processes
(x,t)) send(ok_write, t) to p
25
from a majority of processes; REG=max( REG, v), write(REG)
to p
26
27
28
update(v)
29
30
update(reg)
31
32
33
34
35
36