Question

Consider the following read-write schedule SS over three transactions T1,T2T_1, T_2, and T3T_3, where the subscripts in the schedule indicate transaction IDs:

S:r1(z);  w1(z);  r2(x);  r3(y);  w3(y);  r2(y);  w2(x);  w2(y);S: r_1(z);\; w_1(z);\; r_2(x);\; r_3(y);\; w_3(y);\; r_2(y);\; w_2(x);\; w_2(y);

Which of the following transaction schedules is/are conflict equivalent to SS ?

Choose every correct option
Official answer and solution
Official answer
B, C and D
From
Official GATE 2024 answer key

Solution

Construct the conflict precedence graph for schedule SS and find all valid topological orderings of {T1,T2,T3}\{T_1, T_2, T_3\}.

Checking conflicting operations (pairs of operations from different transactions on the same data item where at least one is a write):

  • Data item zz: Accessed only by T1T_1 (r1(z),w1(z)r_1(z), w_1(z)) →\rightarrow no conflicts.
  • Data item xx: Accessed only by T2T_2 (r2(x),w2(x)r_2(x), w_2(x)) →\rightarrow no conflicts.
  • Data item yy: T3T_3 performs r3(y);w3(y)r_3(y); w_3(y) before T2T_2 performs r2(y);w2(y)r_2(y); w_2(y). Thus the conflicts (r3(y),w2(y))(r_3(y), w_2(y)), (w3(y),r2(y))(w_3(y), r_2(y)), and (w3(y),w2(y))(w_3(y), w_2(y)) all yield the single directed edge T3→T2T_3 \rightarrow T_2 in the precedence graph.

Since T1T_1 has no edges and T3T_3 must precede T2T_2, the serial schedules conflict-equivalent to SS are all topological sorts with T3T_3 before T2T_2: T1T3T2T_1 T_3 T_2 (B), T3T2T1T_3 T_2 T_1 (C), and T3T1T2T_3 T_1 T_2 (D).

Final answer

Options (B), (C), (D)

The answer is the one in the official GATE answer key. The solution is this site's own explanation.

Source

Paper
GATE 2024 Computer Science and Information Technology - Set 1 (CS1)
Question
46 of 65
Section
Computer Science and Information Technology

Report an error in this question

GATE questions are the work of the organising institutes. This site is independent and is not affiliated with them.