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.
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.
Theorem: If acquisition operations that do not result in a completely reducible claim graph are not executed then any system state is safe.
To represent larger graphs, a tabular form is often 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.
To easily check which processes are blocked, an additional column, labeled Potential requests, is maintained in the first table. Each entry represents the sum of all request edges plus all remaining claim edges. A process is blocked if the number of potential requests exceeds the number of available units for any resource.
Dynamic Deadlock Avoidance was originally found on Access 2 Learn