T1 T3 ================================= READ(A, t) READ(A, s) t = t + 100 s = s + 200 WRITE(A, t) WRITE(A, s) READ(B, t) READ(B, s) t = t + 100 s = s + 200 WRITE(B, t) WRITE(B, s) |
T1 T3 ================================= READ(A, t) t = t + 100 WRITE(A, t) READ(A, s) s = s + 200 WRITE(A, s) READ(B, s) s = s + 200 WRITE(B, s) READ(B, t) t = t + 100 WRITE(B, t) |
(It's exactly the same as the previous example, but the operations in T3 is different....
The addition in T3 and T1 commutes !!!)
T1 T3 A B ======================================================= READ(A, t) c c t = t + 100 WRITE(A, t) --------------------> c+100 READ(A, s) s = s + 200 WRITE(A, s) ----> c+300 READ(B, s) s = s + 200 WRITE(B, s) -------------> c+200 READ(B, t) t = t + 100 WRITE(B, t) ------------------------------> c+300 |
T1 T2 A B ======================================================= READ(A, t) c c t = t + 100 WRITE(A, t) --------------------> c+100 READ(A, s) s = 2×s WRITE(A, s) ----> 2c+200 READ(B, s) s = 2×s WRITE(B, s) -------------> 2c READ(B, t) t = t + 100 WRITE(B, t) ------------------------------> 2c+100 |
|
|
|
|
|
|
Notice that:
|
|
ri(X) = transaction Ti reads the DB element X wi(X) = transaction Ti writes the DB element X |
|