GATEverse
← GATE IT 2007

Q66

MCQ2 marks, −0.5

Consider the following two transactions:T1: T1 and T2.T2. T1:read (A);T2:read (B);read (B);read (A);If  A=0  then  B←B+1;If  B≠0  then  A←A–1;write (B);write (A);\begin{array}{clcl} T1: & \text{read (A);} & T2: & \text{read (B);} \\ & \text{read (B);} & & \text{read (A);} \\ & \text{If}\;A = 0\; \text{then}\; B \leftarrow B + 1; & & \text{If}\;B \neq 0\;\text{then}\;A \leftarrow A – 1; \\ & \text{write (B);} & & \text{write (A);}\\\hline\end{array} Which of the following schemes, using shared and exclusive locks, satisfy the requirements for strict two phase locking for the above transactions?

Sign in to save attempts.

Loading…