Module5 Time Stamp
Module5 Time Stamp
T1 T2 T3
100 200 300
Older Younger Youngest
R(A)
R(B)
W(C)
R(B)
R(C)
W(B)
W(A)
R(A)
W(C)
R(B)
R(A)
` R(B)
`
A B C A B C
RTS 0 0 0
WTS 0 0 0 RTS 300 300 100
Check the conditions for Read Check the conditions for Write
a. If WTS(A) > TS(Ti),Rollback Ti. a. If RTS(A)>TS(Ti) then Rollback Ti
b. Otherwise execute R(A) operation b. If WTS(A)>TS(Ti) then Rollback Ti
c. Set RTS(A) = Max{RTS(A),TS(Ti)} c. Otherwise execute Write(A)
Operation
Set WTS(A)=TS(Ti)
R(A) executed first at T1, therefore compare 0<100 (time stamp at T1) and if the condition
passed, set RTS (A) =max{0, 100} and hence RTS (A) is 100.
R(B) Executed second at T2, therefore compare 0<200 (time stamp at T1) and if the
condition passed, set RTS (B) = max {0,200} and hence RTS (B) = 200
W(C) executed third at T1, therefore compare 0<100 (time stamp at T1) and if the condition
passed, set WTS (C) = max(0, 100} and hence WTS (C)=100
R(B) executed fourth (already once done at second), and the value is 200 stored already. Now
R(B) has 300. compare, R(B)=max{200, 300} and hence R(B)=300
Likewise, find the stamp value for all the operations
OP A B C
RTS 100 300 100
WTS 300 200 100