-
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
-
- a serializable schedule
- a schedule that is not conflict serializable
- a conflict serializable schedule
- a schedule for which a precedence graph cannot be drawn
- a serializable schedule
Correct Option: B
Suppose the schedule is
Precedence graph for the schedule So, this is not the conflict serilizable schedule so option (c) is not correct. Also option (d) is eliminated because above, we have drawn the precedence graph. Above schedule is not even view serilizable schedule (it fails the condition of view serializable schedule). So, above schedule is not serializable schedule.