Consider the following schedule for transactions T1, T2 and T3: T1: Read(X); ... Write(X); T2: Read(Y); Write(Y); Read(X); Write(X); T3: Read(Y); Write(X). Interleaved order: R1(X), R2(Y), R3(Y), W2(Y), W1(X), W3(X), R2(X), W2(X). Which one of the schedules below is the correct serialization of the above?
- T1 → T3 → T2
- BT2 → T1 → T3
- CT2 → T3 → T1
- DT3 → T1 → T2
Explanation
Building the precedence graph from all read/write conflicts on X and Y: R1(X) before both W3(X) and W2(X) gives T1->T3 and T1->T2; W1(X) before R2(X)/W2(X) gives T1->T2 again; W3(X) before R2(X)/W2(X) gives T3->T2; R3(Y) before W2(Y) gives T3->T2. Every edge points the same way (T1->T3, T1->T2, T3->T2), giving the unique consistent order T1, T3, T2.
Source: GATE CS 2010 (2010)
This question is part of a 15-day revision cycle — sign in and Project Forge will bring it back the day before you'd forget it.