What is banker's algorithm?
Banker's algorithm is a deadlock avoidance algorithm that is applicable to a resource-allocation system with multiple examples of each resource type. The two algorithms used for its execution are:
a. Safety algorithm: The algorithm for finding out whether or not a system is in a safe state.
b. Resource-request algorithm: if the resulting resource allocation is safe, the transaction is done and process Pi is allocated its resources. If the latest state is unsafe Pi must wait and the old resource-allocation state is restored.