Consider the following transactions with data items P and Q initialized to zero:
T1: read(P); read(Q); if P = 0 then Q := Q + 1; write(Q). T2: read(Q); read(P); if Q = 0 then P := P + 1; write(P).
Any non-serial interleaving of T1 and T2 for concurrent execution leads to
- Aa serializable schedule
- a schedule that is not conflict serializable
- Ca conflict serializable schedule
- Da schedule for which a precedence graph cannot be drawn
Explanation
In any genuinely non-serial interleaving, both transactions read the shared items before either transaction's write takes effect: T1 reads P (value 0) before T2 writes P, giving a precedence edge T1→T2 on P; and T2 reads Q (value 0) before T1 writes Q, giving a precedence edge T2→T1 on Q. These two edges form a cycle in the precedence graph, so the schedule can never be conflict serializable.
Source: GATE CS 2012 (2012)
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.