Consistency Preservation Example
T1: Start;
A = Read(x);
A = A - 1;
Write(y, A);
Commit;
T2: Start;
B = Read(x);
C = Read(y);
If (B > C+1) then B = B - 1;
Write(x, B);
Commit;
Consistency predicate is x > y.
Serial executions preserve consistency.Interleaved executions may not.
H = r1[x] r2[x] r2[y] w2[x] w1[y]
e.g. try it with x=4 and y=2 initially
Previous slide
Next slide
Back to first slide
View graphic version