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?
- 3
- 5
- 6
- 4
Answer:
- (d) 4 resources
- We need
4
resources ofR
because 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
3
resource than deadlock will occur and we are not taking5
or6
because 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.
📱 Contact Me
Twitter
LinkedIn
Telegram
Instagram
Top comments (0)