One approach to dealing with deadlocks is to allow deadlocks to occur and to provide means for detection and recovery. Recovery from a deadlock can be accomplished by destroying one or more of the processes involved in the deadlock, or by removing some of the resources held by the deadlocked processes.
However, this causes a process, or processes, to die, which may upset the user if they were needing them. So alternatively, you may attempt to avoid deadlock by delaying acquisition of resources that could cause deadlock.
The maximum claim of a process is the set of all resources the process may ever request.
A resource claim graph is an extension of the general resource allocation graph. The extended graph shows:
- the current allocation of resources to processes and
- all current as well as all potential future requests by processes for new resources.
The banker’s algorithm emulates the strategy used by a bank when issuing loans. A loan corresponds to a resource allocation and a maximum claim corresponds to the credit limit of a customer (requesting process). The bank grants a request as long as a sequence of loans exist that would satisfy the needs of all customers in some order. Otherwise the granting of the request is postponed.
To represent larger graphs, a tabular form may be used. Separate columns keep track of the different types of edges for each process and each resource. A second table is used to keep track of the currently available units of each resource.
Dynamic Deadlock Avoidance was originally found on Access 2 Learn