Several Instances of a Resource Type
Similar to the Bankerís algorithm safety procedure with the following semantics differences:
- Replacing Need by Waiting where Waitingi is the actual vector of resources process i is currently waiting to acquire.
- May be slightly optimized by initializing Finish[ i ] to true for every process i where Allocationi = 0.
- This is valid because we only care whether there is a deadlock right now. We are optimistic. If processes will need more resources in the future, this might lead to deadlock and we will discover it in the future.
- Processes with a false entry in the end are the ones actually involved in a deadlock at this time.
Complexity (in wait-for graph):