How can the deadlock be prevented
Bankers algorithm: The Resource allocation graph algorithm isn't applicable to a resource allocation system with multiple instances of every resource type .This algorithm isn't as efficient as the above one .It's so called thus because this algorithm is used in banking system to ensure that the bank never allocated its available cash in such a way that it could no longer satisfy the needs of all its customer. In this algorithm there subsist matrices to hold the needed, available and allocated resources.