Skip to content
Official PYQ · 2024

GATE CS 2024 Set 1 Q36 — Transactions and Concurrency Control

Explain with AI

​​​​Consider the following read-write schedule S\text{S} 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 S\text{S}?

Select all correct options
View worked solution

Answer: B;C;D

To find which serial schedules are conflict equivalent to SS, we construct the precedence graph (conflict graph) by identifying conflicting operations between different transactions.

Two operations conflict if they belong to different transactions, access the same data item, and at least one of them is a write operation:

  • On zz: Only T1T_1 accesses zz (r1(z),w1(z)r_1(z), w_1(z)). Thus, there are no conflicts involving zz between different transactions.
  • On xx: Only T2T_2 accesses xx (r2(x),w2(x)r_2(x), w_2(x)). Thus, there are no conflicts involving xx between different transactions.
  • On yy: Both T2T_2 and T3T_3 access yy. The conflicting operations are:
    • w3(y)w_3(y) and r2(y)r_2(y)   ⟹  T3→T2\implies T_3 \to T_2
    • w3(y)w_3(y) and w2(y)w_2(y)   ⟹  T3→T2\implies T_3 \to T_2

Since T1T_1 has no conflicting operations with any other transaction, there are no precedence edges involving T1T_1. The only dependency in the precedence graph is:

T3→T2T_3 \to T_2

Any conflict-equivalent serial schedule must preserve this dependency, meaning T3T_3 must execute before T2T_2. The position of T1T_1 can be anywhere. This gives the following valid serial schedules:

  1. T1T3T2T_1 T_3 T_2 (Option B)
  2. T3T2T1T_3 T_2 T_1 (Option C)
  3. T3T1T2T_3 T_1 T_2 (Option D)

Free practice · Your answers on this page are not saved.

Published
Report a correction
Keep exploringMore Transactions and Concurrency Control questions