A unified treatment of deadlock

  • Authors:
  • Charles M. Shub

  • Affiliations:
  • Computer Science Department, Campus Box ENG-3, University of Colorado at Colorado Springs, Box 7150, Colorado Springs, CO

  • Venue:
  • Journal of Computing Sciences in Colleges
  • Year:
  • 2003

Quantified Score

Hi-index 0.00

Visualization

Abstract

The purpose of this paper is to clear up misconceptions about deadlock and present a cohesive treatment suitable for use in class. First some historical examples are given. This is followed by a formal definition and some examples. Second, the concept of a "joint progress diagram" is introduced and explained and examples of progress trajectories are presented. Within the diagram the complexities of process progression are illustrated. This provides a convenient visualization for the three resource management policies that combine to permit deadlock. Also using the joint progress diagram, the four approaches to dealing with deadlock can be differentiated in a convenient pictorial fashion. Once that is complete, each of the four approaches can be studied in detail. Third the four approaches (prevent, avoid, detect/recover, and ignore) are described and differentiated. The characteristics and usage patterns of resources are described. Then, one policy is chosen for elimination. Once the policy is chosen, there are three different ways to eliminate that policy. These the relative performance of these three choices are compared. The fourth, fifth and sixth topics are deadlock prevention, deadlock avoidance, and deadlock detection. The key concept in avoidance is that even though resources may be available, they should not be allocated if it is imprudent to do so. A simple avoidance algorithm is presented and practical problems with deadlock avoidance are discussed. In detection recovery, the detection algorithm is shown to be similar to the avoidance algorithm and the recovery algorithms are shown to be complex. The paper concludes by offering suggestions on the important points to cover when teaching deadlock.