Question:

A system has 4 redundant units of a resource. There are 3 processes, each requiring 2 units of the resource. Which of the following is TRUE?

Show Hint

To ensure a system is deadlock-free, the number of resources $R$ must be strictly greater than the sum of (Max Demand - 1) for all processes. Mathematically: $R > \sum (M_i - 1)$.
Updated On: Jul 4, 2026
  • Deadlock is certain to occur.
  • Deadlock can never occur.
  • Deadlock occurs only if all processes request resources at the same time.
  • The system is in an unsafe state.
Show Solution
collegedunia
Verified By Collegedunia

The Correct Option is B

Solution and Explanation

Concept:
A deadlock is a situation where a set of processes are blocked because each process is holding a resource and waiting for another resource acquired by some other process. To prevent deadlock in a system with $n$ processes and a single type of resource $R$, we analyze the "worst-case" resource allocation. The fundamental condition to ensure a deadlock-free system is: \[ \text{Total Resources } (R) \geq \sum_{i=1}^{n} (\text{Maximum Demand of } P_i - 1) + 1 \] This formula ensures that even in the worst-case scenario (where every process is one resource short of its maximum requirement), there is at least one remaining resource to allow one process to finish.

Step 1:
Identify system parameters and calculate the maximum "Wait State".
From the question, we have:
• Total number of processes ($n$) = 3
• Maximum requirement of each process ($Max\_D$) = 2
• Total available resource units ($R$) = 4 The "Wait State" or "Danger Zone" occurs when each process holds as many resources as possible without completing. For each process, this is $(Max\_D - 1)$. \[ \text{Max resources held without any process finishing} = 3 \times (2 - 1) = 3 \times 1 = 3 \text{ units.} \]

Step 2:
Analyze the 4th resource unit.
If the system has only 3 units, the processes could each hold 1 unit and wait forever for the 2nd unit (Deadlock). However, the system provides 4 units.
• When 3 units are distributed (1 to each process), 1 unit remains free in the pool.
• This 4th unit will be allocated to one of the 3 processes.
• That process will then have $1 + 1 = 2$ units, fulfilling its maximum requirement.
• It will execute to completion and release both its units back to the system.

Step 3:
Conclusion on system safety.
Because there is always a way for at least one process to finish and release resources for others, a circular wait can never be sustained. Therefore, deadlock is mathematically impossible in this configuration.
Was this answer helpful?
0
0