Skip to content

Beta · Data may be lost.Your data may be reset or lost.

GateBrew
← GATE CSE 2012
Questions

Q27

MCQ2 marks, −0.67DatabasesMedium

Consider the following transactions with data items PP and QQ initialized to zero:

T1read (P);read (Q);if P = 0 then Q := Q + 1; write (Q)T2read (Q);read (P);if Q = 0 then P := P + 1;write (P){\begin{array}{|c|l|r|c|}\hline {T_1}& \text{read (P);}\\ & \text{read (Q);} \\ & \text{if P = 0 then Q := Q + 1; }\\ & \text{write (Q)} \\ \hline {T_2}& \text{read (Q);}\\& \text{read (P);} \\ & \text{if Q = 0 then P := P + 1;} \\ & \text{write (P)} \\ \hline \end{array}}

Any non-serial interleaving of T1 and T2 for concurrent execution leads to

Sign in to save attempts.

Solutions and discussion are hidden while you attempt this question. They open once you check or show the answer.