In a database system, unique timestamps are assigned to each transaction using…

GATE · 2017 · CS · Set 1 · Computer Science & IT

In a database system, unique timestamps are assigned to each transaction using Lamport's logical clock. Let TS(T1)TS(T_1) and TS(T2)TS(T_2) be the timestamps of transactions T1T_1 and T2T_2 respectively. Besides, T1T_1 holds a lock on the resource RR, and T2T_2 has requested a conflicting lock on the same resource RR. The following algorithm is used to prevent deadlocks in the database system assuming that a killed transaction is restarted with the same timestamp.

                                      if  TS(T2)TS(T_2) < TS(T1)TS(T_1) then

​​T1​​T_1 is killed

                                      else ​​T2​​T_2 waits.

Assume any transaction that is not killed terminates eventually. Which of the following is TRUE about the database system that uses the above algorithm to prevent deadlocks?

  1. A.

    The database system is both deadlock-free and starvation-free.

  2. B.

    The database system is deadlock-free, but not starvation-free.

  3. C.

    The database system is starvation-free, but not deadlock-free.

  4. D.

    The database system is neither deadlock-free nor starvation-free.

Attempted by 230 students.

Sign up free to check your answer

Sign up free

Explore the full course: Gate Guidance By Sanchit Sir

Loading lesson…