The drinking philosophers problem
ACM Transactions on Programming Languages and Systems (1984)
- ISSN: 01640925
- DOI: 10.1145/1780.1804
Available from portal.acm.org
or
Abstract
An abstract is not available.
Available from portal.acm.org
Page 1
The drinking philosophers problem
The Drinking Philosophers Problem
K. M. CHANDY and J. MISRA
University of Texas at Austin
The problem of resolving conflicts between processes indistributed systems is of practical importance.
A conflict between a set of processes must be resolved in favor of some (usually one) process and
against he others: a favored process must have some property that distinguishes it from others. To
guarantee fairness, the distinguishing property must be such that the process elected for favorable
treatment is not always the same. A distributed implementation f an acyclic precedence graph, in
which the depth of a process (the longest chain of predecessors) is a distinguishing property, is
presented. A simple conflict resolution rule coupled with the acyclic graph ensures fair resolution of
all conflicts. To make the problem concrete, two paradigms are presented: the well-known distributed
dining philosophers problem and a generalization fit, the distributed rinking philosophers problem.
Categories and Subject Descriptors: D.1.3 \[Programming Techniques\]: Concurrent Programming;
D.4.1 \[Operating Systems\]: Process Management--concurrency; mutual exclusion; synchronization;
D.4.7 \[Operating Systems\]: Organization and Design--distributed systems
General Terms: Algorithms
Additional Key Words and Phrases: Asymmetry, dining philosophers problem
1. INTRODUCTION
We study the problem of fair conflict resolution in distributed systems. Conflicts
can be resolved only if there is some property by which one process in every set
of conflicting processes can be distinguished and selected for favorable treatment;
that is, a conflict is resolved in favor of the distinguished process. In order to
guarantee fairness, the distinguishing property must be such that the process
selected for favorable treatment is not always the same: Traditional schemes for
fair conflict resolution use priorities assigned to processes \[2, 3, 7, 9, 10\] or
probabilistic selection \[5, 8\]. We propose a new approach by using the locations
of shared resources as a distinguishing property. By introducing auxiliary re-
sources, where needed, and by judiciously transferring resources among processes,
we show that all conflicts can be resolved fairly. We propose a paradigm, the
drinking philosophers problem, which captures the essence of conflict resolution
problems in distributed systems. This problem is a generalization ofthe classical
This work was supported by the Air Force Office of Scientific Research under grant AFOSR 8!-0205.
Authors' present addresses: K.M. Chandy, Department of Computer Science, University of Texas at
Austin, Austin, TX 78712; J. Miara, Computer Systems Laboratory, Stanford Electronics Laborato-
ries, Department of Electrical Engineering, Stanford University, Stanford, CA 94305.
Permission to copy without fee all or part of this material is granted provided that the copies are not
made or distributed for direct commercial dvantage, the ACM copyright notice and the title of the
publication and its date appear, and notice is given that copying is by permission of the Association
for Computing Machinery. To copy otherwise, or to republish, requires a fee and/or specific
permission.
© 1984 ACM 0164-0925/84/1000-0632 $00.75
ACM Transactions on Programming Languages and Systems, Vol. 6, No. 4, October 1984, Pages 632-646.
K. M. CHANDY and J. MISRA
University of Texas at Austin
The problem of resolving conflicts between processes indistributed systems is of practical importance.
A conflict between a set of processes must be resolved in favor of some (usually one) process and
against he others: a favored process must have some property that distinguishes it from others. To
guarantee fairness, the distinguishing property must be such that the process elected for favorable
treatment is not always the same. A distributed implementation f an acyclic precedence graph, in
which the depth of a process (the longest chain of predecessors) is a distinguishing property, is
presented. A simple conflict resolution rule coupled with the acyclic graph ensures fair resolution of
all conflicts. To make the problem concrete, two paradigms are presented: the well-known distributed
dining philosophers problem and a generalization fit, the distributed rinking philosophers problem.
Categories and Subject Descriptors: D.1.3 \[Programming Techniques\]: Concurrent Programming;
D.4.1 \[Operating Systems\]: Process Management--concurrency; mutual exclusion; synchronization;
D.4.7 \[Operating Systems\]: Organization and Design--distributed systems
General Terms: Algorithms
Additional Key Words and Phrases: Asymmetry, dining philosophers problem
1. INTRODUCTION
We study the problem of fair conflict resolution in distributed systems. Conflicts
can be resolved only if there is some property by which one process in every set
of conflicting processes can be distinguished and selected for favorable treatment;
that is, a conflict is resolved in favor of the distinguished process. In order to
guarantee fairness, the distinguishing property must be such that the process
selected for favorable treatment is not always the same: Traditional schemes for
fair conflict resolution use priorities assigned to processes \[2, 3, 7, 9, 10\] or
probabilistic selection \[5, 8\]. We propose a new approach by using the locations
of shared resources as a distinguishing property. By introducing auxiliary re-
sources, where needed, and by judiciously transferring resources among processes,
we show that all conflicts can be resolved fairly. We propose a paradigm, the
drinking philosophers problem, which captures the essence of conflict resolution
problems in distributed systems. This problem is a generalization ofthe classical
This work was supported by the Air Force Office of Scientific Research under grant AFOSR 8!-0205.
Authors' present addresses: K.M. Chandy, Department of Computer Science, University of Texas at
Austin, Austin, TX 78712; J. Miara, Computer Systems Laboratory, Stanford Electronics Laborato-
ries, Department of Electrical Engineering, Stanford University, Stanford, CA 94305.
Permission to copy without fee all or part of this material is granted provided that the copies are not
made or distributed for direct commercial dvantage, the ACM copyright notice and the title of the
publication and its date appear, and notice is given that copying is by permission of the Association
for Computing Machinery. To copy otherwise, or to republish, requires a fee and/or specific
permission.
© 1984 ACM 0164-0925/84/1000-0632 $00.75
ACM Transactions on Programming Languages and Systems, Vol. 6, No. 4, October 1984, Pages 632-646.
Page 2
The Drinking Philosophers Problem • 633
dining philosophers problem \[2, 3\]. We present both problems formally in the
following sections. This section presents an informal introduction to the problem
of conflict resolution in distributed systems.
Two or more processes cannot execute certain actions simultaneously: for
instance, two processes cannot hold "write locks" on the same data item at the
same time. Conflicts arise when two or more processes attempt to carry out such
actions simultaneously. The resolution of such a conflict requires that some
processes be treated differently from others in the sense that the conflict be
resolved in favor of some processes and against other conflicting processes. If all
processes in a set of conflicting processes are indistinguishable (i.e., if every
property that holds for one process also holds for the others), then it is impossible
to resolve conflicts between them without resorting to random selection. This is
because any deterministic algorithm that selects one of the processes for favorable
treatment must carry out the selection on the basis of some property that holds
for that process and not for the others. Therefore, if we do not wish to use
probabilistic algorithms to resolve conflicts, we must ensure the following invar-
iant:
Distinguishability. In every state of the system at least one process in every
set of conflicting processes must be distinguishable from the other processes of
the set.
An example of a distinguishing property is a process's identity number (pro-
vided that it is different from the identity numbers of all processes that it may
conflict with).
Fairness. Usually we require not only that conflicts be resolved but also that
they be resolved fairly, that is, conflicts should not always be resolved to the
detriment of a particular process. If conflicts always occur in the same system
state, a deterministic conflict resolution scheme will always resolve conflicts in
the same way because the outcome of a deterministic scheme is a function of the
system state. In this case conflict resolution will be unfair. Fairness requires that
the states that obtain when conflicts occur not always be identical. An example
of state information used to ensure that conflicts arise in different system states
is time, where time may be determined by a centralized, global clock or by
distributed logical clocks \[7\]: every request (which may result in a conflict) is
timestamped, and a conflict between two requests is resolved in favor of the one
with the smaller timestamp. However, conflicts between processes with equal
timestamps must be resolved by using some other distinguishing property (such
as process IDs). The state information used to ensure fairness may reside in a
single process (the centralized solution) or it may be distributed. This paper is
about distributed schemes to ensure (1) distinguishability and (2) fairness.
We describe our problem informally by using a graph model of conflict. A
distributed system is represented by an undirected graph G with a one-to-one
correspondence b tween vertices in G and processes in the system. Edge (u, v)
exists in G if and only if there may be a conflict between (the processes
corresponding to) vertices u and v. We assume that there is some mechanism
that, in every state of the system, ascribes a precedence ordering to every pair of
ACM Transactions on Programming Languages and Systems, V~ol. 6, No. 4, October 1984.
dining philosophers problem \[2, 3\]. We present both problems formally in the
following sections. This section presents an informal introduction to the problem
of conflict resolution in distributed systems.
Two or more processes cannot execute certain actions simultaneously: for
instance, two processes cannot hold "write locks" on the same data item at the
same time. Conflicts arise when two or more processes attempt to carry out such
actions simultaneously. The resolution of such a conflict requires that some
processes be treated differently from others in the sense that the conflict be
resolved in favor of some processes and against other conflicting processes. If all
processes in a set of conflicting processes are indistinguishable (i.e., if every
property that holds for one process also holds for the others), then it is impossible
to resolve conflicts between them without resorting to random selection. This is
because any deterministic algorithm that selects one of the processes for favorable
treatment must carry out the selection on the basis of some property that holds
for that process and not for the others. Therefore, if we do not wish to use
probabilistic algorithms to resolve conflicts, we must ensure the following invar-
iant:
Distinguishability. In every state of the system at least one process in every
set of conflicting processes must be distinguishable from the other processes of
the set.
An example of a distinguishing property is a process's identity number (pro-
vided that it is different from the identity numbers of all processes that it may
conflict with).
Fairness. Usually we require not only that conflicts be resolved but also that
they be resolved fairly, that is, conflicts should not always be resolved to the
detriment of a particular process. If conflicts always occur in the same system
state, a deterministic conflict resolution scheme will always resolve conflicts in
the same way because the outcome of a deterministic scheme is a function of the
system state. In this case conflict resolution will be unfair. Fairness requires that
the states that obtain when conflicts occur not always be identical. An example
of state information used to ensure that conflicts arise in different system states
is time, where time may be determined by a centralized, global clock or by
distributed logical clocks \[7\]: every request (which may result in a conflict) is
timestamped, and a conflict between two requests is resolved in favor of the one
with the smaller timestamp. However, conflicts between processes with equal
timestamps must be resolved by using some other distinguishing property (such
as process IDs). The state information used to ensure fairness may reside in a
single process (the centralized solution) or it may be distributed. This paper is
about distributed schemes to ensure (1) distinguishability and (2) fairness.
We describe our problem informally by using a graph model of conflict. A
distributed system is represented by an undirected graph G with a one-to-one
correspondence b tween vertices in G and processes in the system. Edge (u, v)
exists in G if and only if there may be a conflict between (the processes
corresponding to) vertices u and v. We assume that there is some mechanism
that, in every state of the system, ascribes a precedence ordering to every pair of
ACM Transactions on Programming Languages and Systems, V~ol. 6, No. 4, October 1984.
Sign up today - FREE
Mendeley saves you time finding and organizing research. Learn more
- All your research in one place
- Add and import papers easily
- Access it anywhere, anytime
Start using Mendeley in seconds!
Readership Statistics
11 Readers on Mendeley
by Discipline
by Academic Status
27% Student (Master)
18% Ph.D. Student
18% Professor
by Country
18% France
18% Brazil
9% Japan


