Consider the following schedule S of transactions T1 and T2:

2004

Consider the following schedule S of transactions T1 and T2:

image.png

  1. A.

    S is serializable only as T1, T2

  2. B.

    S is serializable only as T2, T1

  3. C.

    S is serializable both as T1, T2 and T2, T1

  4. D.

    None of these

Attempted by 60 students.

Show answer & explanation

Correct answer: D

To determine if schedule S is serializable, we analyze the operations of T1 and T2 for conflicts.

Step 1: List the operations in order:

T1: Read(A), A = A - 10, Write(A), Read(B), Write(B)

T2: Read(A), Temp = 0.2*A, Write(A), Read(B), B = B + Temp, Write(B)

Step 2: Identify conflicting operations (read-write, write-read, write-write on same data item).

Conflicts:

  • T1 writes A after T2 reads A → T2 → T1

  • T1 writes B after T2 reads B → T2 → T1

  • T2 writes A after T1 writes A → T1 → T2

Step 3: Construct the precedence graph:

Edges: T2 → T1 (from A and B conflicts), T1 → T2 (from A write-write conflict).

Step 4: Check for cycles. The graph has a cycle: T1 → T2 → T1.

Step 5: Since the precedence graph contains a cycle, the schedule is not conflict-serializable.

Therefore, the correct answer is D: None of these.

Explore the full course: Gate Guidance By Sanchit Sir