Consider the following schedule for transactions \(T1, T2\) and \(T3\):…

2010

Consider the following schedule for transactions \(T1, T2\) and \(T3\):

\(\begin{array}{|c|c|c|}\hline \textbf{T1} & \textbf{T2} & \textbf{T3} \\\hline \text{Read(X)} & \text{} & \text{} \\\hline \text{} & \text{Read(Y)} & \text{} \\\hline \text{} & \text{} & \text{Read(Y)} \\\hline \text{} & \text{Write(Y)} & \text{} \\\hline \text{Write(X)} & \text{} & \text{} \\\hline \text{} & \text{} & \text{Write(X)} \\\hline \text{} & \text{Read(X)} & \text{} \\\hline \text{} & \text{Write(X)} & \text{} \\\hline\end{array}\)

Which one of the schedules below is the correct serialization of the above?

Answer: A. \(T1 \to T3 \to T2\)Key insight: construct the precedence graph from conflicting operations. Timeline of operations (top to bottom): T1: Read(X); T2: Read(Y); T3: Read(Y); T2:…

  1. A.

    \(T1 \to T3 \to T2\)

  2. B.

    \(T2 \to T1 \to T3\)

  3. C.

    \(T2 \to T3 \to T1\)

  4. D.

    \(T3 \to T1 \to T2\)

Attempted by 436 students.

Show answer & explanation

Correct answer: A

Key insight: construct the precedence graph from conflicting operations.

  • Timeline of operations (top to bottom): T1: Read(X); T2: Read(Y); T3: Read(Y); T2: Write(Y); T1: Write(X); T3: Write(X); T2: Read(X); T2: Write(X).

  • Identify conflicts and add directed edges:

    • Between T1 and T3 on X: T1's Read(X) and Write(X) occur before T3's Write(X) → conflicts produce edge T1 → T3.

    • Between T1 and T2 on X: T1's Write(X) occurs before T2's later Read(X)/Write(X) → edge T1 → T2.

    • Between T3 and T2 on Y and X: T3's Read(Y) occurs before T2's Write(Y), and T3's Write(X) occurs before T2's Read/Write(X) → edge T3 → T2.

  • Precedence graph edges: T1 → T3, T1 → T2, T3 → T2. A topological ordering consistent with these edges is T1, then T3, then T2.

Therefore the correct serial schedule equivalent to the given interleaving is T1 → T3 → T2.

A video solution is available for this question — log in and enroll to watch it.

Explore the full course: Iocl Engineers Officers Grade A Paper 2

Loading lesson…