In distributed systems there can be two types of deadlocks. First is a resource deadlock which occurs when two or more processes wait permanently for resource held by each other and second is communication deadlocks which occur among a set of processes when they are …