Similar questions 1 more →
Deadlocks

Answer & solution
Official answer: B
Step through it (2 checks)
1. Method and setup. Compute Need=Max−Allocation. For each request separately, tentatively decrease Available and increase the requester’s Allocation, then try to find a complete safe sequence. Sufficient available resources for the immediate grant is necessary but not sufficient; the updated state must still permit every process to finish.
2. Work through the result and its assumptions. Initial needs are P0=(8, 4, 2), P1=(3, 0, 0), P2=(1, 2, 2). Grant REQ1: available=(3, 2, 0); only P1 can finish, releasing(3, 2, 0) to give(6, 4, 0). Neither remaining process can finish, so unsafe. Grant REQ2: available=(1, 2, 2), P1 need=(1, 0, 0); finish P1 to get(6, 4, 2), then P2 to get(8, 5, 3), then P0. Only REQ2 is safe, B.