CS FundamentalsHardGATE CS
A system has 4 instances of R1 and 2 of R2. Allocated: P1 holds 1 R1; P2 holds 2 R1 and 1 R2; P3 holds 1 R1 and 1 R2. Requests: P1 wants 1 R2; P2 wants 1 R1; P3 wants nothing more. Which statement is correct?
- A. The system is deadlocked: P1 and P2 wait in a cycle
- B. Only P3 can finish; P1 and P2 then stay deadlocked on each other
- C. No deadlock: P3 finishes, after which P1 and P2 can both complete
- D. Deadlock detection cannot decide, since R1 has multiple instances
Correct answer: C. No deadlock: P3 finishes, after which P1 and P2 can both complete
Available is (0, 0). P3 needs nothing, finishes and frees (1, 1). Now P1's request (0, 1) or P2's request (1, 0) can be met, and after each finishes the other can too. A cycle with multi-instance resources does not imply deadlock.
More Operating Systems questions
- Which statement about a process that calls exec() successfully is correct?
- A logical address space has 8 pages of 2 KB each, and physical memory has 32 frames. How many bits are in a logical address and in a…
- Reference string 1, 2, 3, 1, 4, 5, 1, 6, 2, 1, 3, 4 with 3 frames, initially empty. The clock (second-chance) algorithm sets a page's…
- TLB lookup 20 ns (done first), memory access 100 ns, single-level page table, TLB hit ratio 80%. In addition, 1 in every 1,000 memory…
- A bounded buffer uses semaphores empty = N, full = 0 and mutex = 1. The producer is changed to do wait(mutex) BEFORE wait(empty); the…
- Jobs A (6), B (2), C (8) and D (3) all arrive at time 0 in that order. What are the average waiting time under non-preemptive SJF and the…