An operating system contains 3 user processes each requiring 2 units o...
Dead lock occurs when each of the 3 user processes hold one resource and make simultaneous demand for another. If there are 4 resources one of the 3 user processes will get the fourth instance of the resource and release one or both of the resource it is currently holding after using.
View all questions of this test
An operating system contains 3 user processes each requiring 2 units o...
To understand the solution to this question, let's first define what deadlock is. Deadlock occurs when two or more processes are unable to proceed because each is waiting for resources held by the other process(es).
In this scenario, we have an operating system with 3 user processes, each requiring 2 units of resource R. We need to determine the minimum number of units of resource R required to avoid deadlock.
Understanding the Problem:
- We have 3 user processes, and each requires 2 units of resource R. So, the total resource requirement is 3 * 2 = 6 units of resource R.
- To avoid deadlock, we need to ensure that all the processes can acquire the required resources simultaneously.
Explanation:
To avoid deadlock, the operating system must have enough units of resource R to fulfill the requirements of all the processes. Let's consider the options given:
a) 3 units of resource R: This is not sufficient because we have a total resource requirement of 6 units.
b) 4 units of resource R: This is the correct answer. With 4 units of resource R, each process can acquire the required 2 units of resource R simultaneously without any deadlock.
c) 5 units of resource R: This is more than the required 4 units and would be sufficient to avoid deadlock. However, the minimum number of units required is 4.
d) 6 units of resource R: This is more than the required 4 units and would be sufficient to avoid deadlock. However, the minimum number of units required is 4.
Therefore, the correct answer is option 'b' - 4 units of resource R.
Summary:
To avoid deadlock in the given scenario, the operating system needs a minimum of 4 units of resource R. With 4 units, each process can acquire the required 2 units simultaneously, ensuring that no deadlock occurs.