A modular drinking philosophers algorithm

  • Authors:
  • Jennifer L. Welch;Nancy A. Lynch

  • Affiliations:
  • Department of Computer Science, Texas A & M University, College Station, TX and Laboratory for Computer Science, Massachusetts Institute of Technology;Laboratory for Computer Science, MIT, Cambridge, MA

  • Venue:
  • Distributed Computing
  • Year:
  • 1993

Quantified Score

Hi-index 0.00

Visualization

Abstract

A variant of the drinking philosophers algorithm of Chandy and Misra is described and proved correct in a modular way. The algorithm of Chandy and Misra is based on a particular dining philosophers algorithm and relies on certain properties of its implementation. The drinking philosophers algorithm presented in this paper is able to use an arbitrary dining philosophers algorithm as a subroutine; nothing about the implementation needs to be known, only that it solves the dining philosophers problem. An important advantage of this modularity is that by substituting a more time-efficient dining philosophers algorithm than the one used by Chandy and Misra, a drinking philosophers algorithm with O(1) worst-case waiting time is obtained, whereas the drinking philosophers algorithm of Chandy and Misra has O(n) worst-case waiting time (for n philosophers). Careful definitions are given to distinguish the drinking and dining philosophers problems and to specify varying degrees of concurrency.