A modified approach to deadlock prevention which is an optimized bankers Algorithm. This is our operating systems project which we submitted. This new approach solves cases where Bankers fails to excecute.
Algorithm Used:-
- We first apply Bankers algorithm to check whether it is successful in generating a safe sequence or not.
- If Bankers algorithm fails in generating a safe sequence, we check which process is causing deadlock.
- Then we check which resources of the process are exceeding the limit.
- Now we preempt that process which has most instances of the resource causing the deadlock.
- Thus the deadlock is removed.
- The process remains in unsafe state if the resource required by that process exceeds the total number of resources of that type held by all the other processes.