In a database system, unique timestamps are assigned to each transaction using Lamport's logical clock. Let TS(T1)TS(T1) and TS(T2)TS(T2) be the timestamps of transactions T1T1 and T2T2 respectively. Besides, T1T1holds a lock on the resource R, and T2T2 has requested a conflicting lock on the same resource R. The following algorithm is used to prevent deadlocks in the database system assuming that a killed transaction is NOT restarted with the same timestamp.
if TS(T2)<TS(T1) then
T1 is killed
else T2 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?
- The database system is both deadlock-free and starvation-free.
- The database system is deadlock-free, but not starvation-free.
- The database system is starvation-free, but not deadlock-free.
- The database system is neither deadlock-free nor starvation-free.
What i tink
if T1 its not restarted with the same timestamp .... and its given a new timestamp and that will definetely be higher than TS(T2)
which is still making TS(T1) younger...now when T2 is done..T1 executes ...
So if the TS(T1) is restarted with same timestamp or different is actually not making a difference
but it is discussed that if T1 starts again with new timestamp then there would be starvation..how??