GATE / CS ARCHIVE

GATE CSE 2017 SET 1 / QUESTION 42

GATE CSE 2017 Set 1 Q42

Operating Systems · Deadlocks · Full GATE CSE 2017 Set 1 paper

GATE 2017 Set 1, Q42 2 marks · MCQ
Report issue

Deadlocks

Question 42, GATE 2017: Transactions receive unique Lamport timestamps. T1 holds resource R; T2 requests a conflicting lock. If TS(T2)<TS(T1), kill T1; otherwise T2 waits. Killed transactions restart with the same timestamp; any transaction not killed eventually terminates. A both deadlock-free and starvation-free; B deadlock-free only; C starvation-free only; D neither.
Tap to enlarge
Your answer
Answer & solution

Official answer: A

1. Smaller timestamps denote older transactions. An older requester wounds a younger holder; a younger requester waits rather than aborting the older holder. This is wound-wait.

2. Every actual waiting edge points from a younger transaction to an older one, so timestamps strictly decrease along waits. A directed cycle would require returning to the original timestamp after strict decreases, impossible. Hence no deadlock.

3. A restarted transaction keeps its old timestamp, so it does not repeatedly become youngest. With the stated eventual-termination assumption and finitely many older predecessors, those predecessors finish and it ultimately becomes able to proceed. This is the intended starvation-free guarantee, A.

Original paper, page 19 · Answer key