Question on Deadlock | Operating System - M04 P07
This is a multipart blog article series, and in this series I am going to explain you the concepts of operating system. This article series is divided into multiple modules and this is the forth module which consists of 8 articles.
In this article we will see one question based on the concept of deadlock in an operating system.
Question: A system is having 3 processes each requires 2 units of resources R. The minimum number of units of R requires such that no deadlock will occur?
- (d) 4 resources
- We need
Rbecause then in worst condition when all the processes request for resource we can give one resource to every process and still one resource will be remaining.
- If we give that resource to any process than it will get terminate because one process require only two resources and when they get that their execution will be complete.
- Now we have two free resources and two processes that need two resources and hence they will also get executed and thus no deadlock will occur.
- If we take
3resource than deadlock will occur and we are not taking
6because we need to find minimum number of resources.
So this was a simple question on deadlock in an operating system. Hope you liked it and learned something new from it.
If you have any doubt, question, quires related to this topic or just want to share something with me, than please feel free to contact me.