(a) (6 marks) Consider the schedule below. Here, R(·) and W(·) stand for ‘Read’ and ‘Write’, respectively. T₁, T₂, T₃ and T₄ represent four transactions and tቢ represents a time slot.
Time | t₁ | t₂ | t₃ | t₄ | t₅ | t₆ | t₇ | t₈ | t₉
--- | --- | --- | --- | --- | --- | --- | --- | --- | ---
T₁ | | W(Y) | | | R(X) | | | |
T₂ | | | | | | R(Y) | W(Z) | |
T₃ | | | | R(Z) | | | | R(Y) | R(X)
T₄ | W(Y) | | W(X) | | | | | |
1. Give the precedence graph of this schedule. (3 marks)
2. Is this schedule conflict serializable? If your answer is ‘‘yes’’, please providing the equivalent serial schedule. If your answer is ‘‘no’’, convert it to a conflict serializable schedule with the minimum change in the scheduling while preserving the given ordering of operations in each transaction. (3 marks)
(b) (6 marks) Consider the lock request sequence given below. RL() and WL() stand for ‘‘read lock’’ and ‘‘write lock’’, respectively. T₁, T₂, T₃ and T₄ represent four transactions.
Time | t₁ | t₂ | t₃ | t₄ | t₅ | t₆ | t₇ | t₈
--- | --- | --- | --- | --- | --- | --- | --- | ---
T₁ | | | | WL(B) | | RL(A) | |
T₂ | | | WL(A) | | WL(C) | | |
T₃ | WL(C) | | | | | | | RL(B)
T₄ | | RL(B) | | | | | WL(C) |
1. Determine whether there exists a deadlock in the lock requests and justify your answer. (3 marks)
2. For the four transactions, construct a serializable but non-serial schedule using two-phase locking mechanism. If this is impossible, please justify your answer. (3 marks)