ABSTRACT

This chapter discusses methods for prevention, avoidance, and detection of deadlock in distributed systems. There are three strategies for handling deadlocks: deadlock prevention, deadlock avoidance, and deadlock detection and recovery. Both deadlock prevention and avoidance use a pessimistic approach: Assume that deadlock will occur and try to prevent or avoid it. There are in general two types of deadlock: resource deadlock, and communication deadlock. Deadlock prevention algorithms prevent deadlocks by restraining how process requests can be made. Although deadlock avoidance strategies are often used in centralized systems and many algorithms have been proposed, they are rarely used in a distributed system. In deadlock avoidance, the concept of a safe state is introduced which is dependent on the application. In the bridge crossing example, there is no need to place any constraints on moving directions in deadlock avoidance. Deadlock detection and recovery uses an optimistic approach. However, it may not be efficient for applications where deadlocks occur frequently.