What is banker's algorithm?
Banker's algorithm is a deadlock avoidance algorithm that is applicable to a resource-allocation system with multiple instances 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 completed and process Pi is allocated its resources. If the new state is unsafe Pi must wait and the old resource-allocation state is restored.