59.2k views
0 votes
Consider a system with multiple resource types which checks

the safety condition using the single-resource type Banker's algorithm for each type.
Give an example of when the safety condition for each type is satisfied, but the system
itself is not in a safe state. That is, with respect to each individual resource type, the
system may be in a safe state, but it would be unsafe according to
the multiple-resource type Banker's algorithm.
In your example, only consider the case of two resource types.

1 Answer

5 votes

Final answer:

A system can be in a safe state for each individual resource type but be in an unsafe state according to the multiple-resource type Banker's algorithm due to deadlock caused by resource allocation.

Step-by-step explanation:

An example of when the safety condition for each resource type is satisfied but the system is not in a safe state according to the multiple-resource type Banker's algorithm is when there is a deadlock caused by resource allocation. Consider a system with two resource types: A and B.

Suppose there are two processes, P1 and P2. P1 has allocated resource A and needs resource B, while P2 has allocated resource B and needs resource A.

Both processes cannot proceed because they are waiting for the resource held by the other process, resulting in a deadlock.

User KarthiS
by
8.1k points