CS FundamentalsHardGATE CS
Wound-wait and wait-die are timestamp-based deadlock-prevention schemes. Older transactions have smaller timestamps. In WAIT-DIE, what happens when an OLDER process requests a resource held by a YOUNGER one, and when a YOUNGER requests from an OLDER?
- A. Older preempts (wounds) the younger; younger waits
- B. Both wait
- C. Older waits; younger is rolled back (dies)
- D. Older is rolled back; younger waits
Correct answer: C. Older waits; younger is rolled back (dies)
Wait-die is non-preemptive: an older requester is allowed to wait, a younger requester dies and restarts with its original timestamp. Wound-wait is the preemptive opposite: the older wounds the younger, the younger waits.
More Operating Systems questions
- Semaphores S = 1, T = 0, U = 0. X: wait(S); print('A'); signal(T). Y: wait(T); print('B'); signal(U). Z: wait(U); print('C'); signal(S)…
- Semaphores x = 0 and y = 0. P1: print('A'); signal(x); wait(y); print('B'). P2: print('C'); signal(y); wait(x); print('D'). Which of the…
- Shared int x = 0. Two threads each execute x = x + 1; TWICE, without synchronisation; each statement is a load into a private register, an…
- Shared int x = 1. Thread T1 executes x = x 2; and T2 executes x = x + 3; concurrently with no locking (each is load, compute, store). How…
- Which property does Peterson's algorithm guarantee for two processes, assuming loads and stores are atomic and NOT reordered?
- A test-and-set spinlock: while (TestAndSet(&lock)); / CS / lock = false;. Which requirement of the critical-section problem does it NOT…