CS FundamentalsHardGATE CS (PYQ pattern)
Each of 8 processes P0..P7 waits for at most one other process (single-instance resources). The wait-for relation is: P0 waits for P1, P1 for P2, P2 for P0, P3 for P2, P4 for P3, P6 for P5, P7 for P4; P5 waits for nobody. How many processes can never proceed unless the OS intervenes (those in a deadlock cycle plus those waiting, directly or indirectly, for a deadlocked process)?
- A. 3
- B. 6
- C. 5
- D. 7
Correct answer: B. 6
P0, P1, P2 form a cycle (deadlock). P3 waits on P2, P4 on P3 and P7 on P4, so they are stuck too: 6 in all. P6 only waits for P5, which runs freely, so P5 and P6 will finish.
More Operating Systems questions
- Single resource type, 5 processes. Allocation: 2, 2, 0, 1, 4. Maximum: 3, 3, 8, 2, 6. Available = 3. The state is safe. What is the…
- Semaphores s = 1, t = 0. P1: wait(s); print A; print B; signal(s). P2: wait(s); print C; signal(s). P3: wait(t); print D; signal(s). P4…
- Semaphores a = 1, b = 0, c = 0. P1: wait(a); print x; signal(b). P2: wait(b); print y; signal(c). P3: wait(c); print z; signal(a). P4…
- Round Robin with quantum 4 ms; processes (arrival, burst) in ms: A (0, 11), B (2, 6), C (3, 3), D (5, 9), E (8, 2). A process that arrives…
- The head is at cylinder 50. Pending requests in arrival order: 82, 170, 43, 140, 24, 16, 190. By how many cylinders is the total head…
- NRU replacement runs with 3 frames (initially empty). Each page has bits (R, M): R is set on every reference, M on every write, and a…