CS FundamentalsModerateGATE CS
In a resource-allocation graph where EVERY resource type has exactly one instance, which statement is correct?
- A. A cycle is necessary but not sufficient for deadlock
- B. A cycle is both necessary and sufficient for deadlock
- C. A cycle is sufficient but not necessary for deadlock
- D. Deadlock can occur even if the graph has no cycle
Correct answer: B. A cycle is both necessary and sufficient for deadlock
With single-instance resources, a cycle means every process in it waits for a resource held by the next, so deadlock exists; and any deadlock creates a cycle. With multiple instances a cycle is necessary but not sufficient.
More Operating Systems questions
- Which deadlock-handling idea attacks the CIRCULAR WAIT condition?
- How many of these statements about deadlock are correct? 1. A safe state guarantees that no deadlock will occur if processes follow their…
- Wound-wait and wait-die are timestamp-based deadlock-prevention schemes. Older transactions have smaller timestamps. In WAIT-DIE, what…
- 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…