There are 5 processes in a system. The maximum number of records a process can take is 2. At a time, a process can take only a single resource and can free only a single resource. How many records are required to ensure deadlock-free execution _________?
Correct Answer :
6
Solution :
The correct option is 6.
To determine the minimum number of resources (records) required to guarantee a deadlock-free execution in a system, we can apply the resource allocation principles for deadlock prevention.
Let:
- The number of processes be P.
- The maximum demand of resources for each process i be Ri.
- The total number of resources in the system be R.
Here, we are given:
- Number of processes,
- Maximum resource requirement for each process,
for all processes.
A deadlock occurs in the worst-case scenario when every process has acquired one less than its maximum requirement and is waiting for one more resource. In this state, all processes are blocked, and no progress can be made.
To find this worst-case allocation where deadlock is just about to occur, we allocate
resources to each process:
Substituting the values:
If we have exactly 5 resources, each of the 5 processes can hold 1 resource. Since each process needs 2 resources to finish, they will all wait indefinitely for another resource, resulting in a deadlock.
To ensure a deadlock-free execution, we must add at least 1 more resource to the system. This extra resource will allow at least one process to satisfy its maximum demand, complete its execution, and release all of its held resources back to the pool for other processes to use.
Thus, the minimum number of resources R required to guarantee deadlock-free execution is:
Therefore, a minimum of 6 records are required to ensure deadlock-free execution.
Access expert-curated educational resources and study materials—completely free.
Create, conduct, and manage professional online assessments with Mindyard. Perfect for teachers and institutes.
Copyright © 2026 Mindyard. All Rights Reserved.