Skip to content

What does each process still need?

The situation

A system has 10 units of one resource and three processes.

| Process | Allocated | Maximum need | |---|---|---| | P0 | 3 | 9 | | P1 | 2 | 4 | | P2 | 2 | 7 |

So 7 units are allocated and 3 are available.

The Banker's algorithm asks whether there is an order in which every process can finish: give a process what it still needs, let it run to completion, reclaim everything it held, and repeat. A state is safe if such an order exists.

Remaining need is maximum minus allocated.

What are the remaining needs of P0, P1 and P2?