Given: A system has R identical resources, P processes competing for them and N is the maximum need of each process. The task is to find the minimum number of Resources required So that deadlock will never occur.
R >= P * (N - 1) + 1
Input : P = 3, N = 4 Output : R >= 10 Input : P = 7, N = 2 Output : R >= 8
Consider, 3 process A, B and C.
Let, Need of each process is 4
Therefore, The maximum resources require will be 3 * 4 = 12 i.e, Give 4 resources to each Process.
And, The minimum resources required will be 3 * (4 – 1) + 1 = 10.
i.e, Give 3 Resources to each of the Process, and we are left out with 1 Resource.
That 1 resource will be given to any of the Process A, B or C.
So that after using that resource by any one of the Process, It left the resources and that resources will be used by any other Process and thus Deadlock will Never Occur.
R >= 10
- Operating System | Recovery From Deadlock
- Operating System | Deadlock detection algorithm
- Operating System | Process Management | Deadlock Introduction
- Operating System | Free space management
- Operating Systems | Deadlock | Question 1
- Operating Systems | Deadlock | Question 2
- Hierarchical Deadlock Detection in Distributed System
- Operating System | Program for Next Fit algorithm in Memory Management
- Operating System | Buddy System - Memory allocation technique
- Operating System | Requirements of memory management system
- Operating System | Semaphores in operating system
- Operating System | Introduction of Operating System - Set 1
- Operating System | Starvation and Aging in Operating Systems
- Operating System | Introduction of System Call
- Operating System | Unix File System
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to email@example.com. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.