Sei sulla pagina 1di 6

ON THE ADVANTAGES

OF FREE CHOICE:

A SYMMETRIC AND FULLY DISTRIBUTED


SOLUTION TO THE DINING
PHILOSOPHERS
PROBLEM
(Extended

Abstract)
by

Daniel

Lehmann
and

Michael

0.

Mathematics
Hebrew

Rabin*
Institute

University

Jerusalem,

Israel

Abstract

Concurrent

progranurring

particularly
It

is

bilistic

shown

that

than

are

distributed

i.e.,

realized

ted

on

the

shown

that,

is

way

no

are

certain

only

by

dining

hand,

dom

of

if

one)

under

one

any

scheduling)

or

to

solution

process

with

to

involve

which

every

(even

an

Since

the

As

introduced

in

different
more

to

to

[12]),
to

the
some

tion

for

is

distributed

this

idea

exhibit

to

the

this

with

is

same
and

in

Michael

Rabin

Science

and

University,
Mass.

is

Vinton
Aiken

02138,

for

Visiting
Hayes

Senior

to

Computation

Lab.,

the

academic

1980-81

1981

ACM

a fee

and/or

O-89791

specific
-029

-X/81

example

of

probabilistic

be

solved

the

by

system

proved

to

of

deter-

probabil-

behave

and

not

one

as

one

of

correctness

that

many

not

realize

yet

just

correctly

with

probability

likes.

one

hope

that

proofs.

We
some

hints

as

to

what

could

be

the

such

to

introduce

proofs.

Of

In
in

activities
It
a
the

turns

activities

methodology

will

be

impossible
these

in

other

to

share

in

de-

exter-

time,

and

this

correctness.

concerning

useful

of

activities.

which

of

time

distributed

is

proof

occasion

in

ordered
our

concepts
systems

have

on

processes

for

this

it

totally

suffices

time

in

of
are

we

processes
that

will

formal

ordering

ordering

correct)

incorrect

important

an

out
total

variables

that

proba-

slippery;

exercise
the

particular,

of

natural

of

adequate

Section

for

(hopefully

present
what

concurthe

extremely

sequence

the

As

correctness
are
here

in

provide

for

of

presented

for

known.

systems

last

and

well

proofs

proof

hope

every
We

proofs

is

the

property

and

of

the

the

We
handling

contexts

as

well.

feel
Our

ways.

analysis

ideas

of

and

the

the

interplay

area

of

Computer

processors

suggests

an

application

at

Harvard

biological

systems

where

all

number

of

randomness,

Cambridge,

city

year.

of

large
those

permission.

of

problem

language
do

CSP

not

use

cols

pr.vid.

that

the

their

random
an
ideas

other
and

M.

such
[61;

Rodeh

solution

simpli-

We

presented

here
the
between

the

really

philosophers
[4]

have,

that
to

should
of

concurin

the

feel

area

synchro-

first

written

solufiion

in

for

solution

draws).

problems

of

of

and

the

dining

.Ieyant

cooperation

simple

theory

features

here

the

and

proposed

the

components

are

to

Francez

(N.

rently,

to

of

appear.

philosophers

solution

probabil-

systems

three

presented

the

distributed

control

133

protocols

nization

solve

/O100-O133$O0.75

components

between

large

of

The

requires

an

by

to

fact

But,

Permission to make digital or hard copies of part or all of this work or


personal or classroom use is granted without fee provided that copies are
not
made or distributed
for profit
advantage
Permission
to copy without
fee or
all commercial
or part of this
material and
is that
grant-copies
bear
this notice
andthe
thecopies
full citation
on the
firstorpage.
To copyforotherwise,
to
ed provided
that
are not
made
distributed
direct
republish,
post on servers,
or tocopyredistribute
to its
lists,
commercial to advantage,
the ACM
right and
daterequires
appear, prior
specific
permission and/or a fee.
and notice is given that copying is by permission of the Associa.
tion
1981
0-89791-029-X$5.00
for ACM
Computing
Machinery.
To copy otherwise, or to republish,

provides

one

only

nal

problem

eat

Fellow

later,
be

in

fine

will

this

Professor

of

correctly

attractive.

cannot

see

is

istic
*

out

performs

very

solved

may

close

realm

system.

application

one,

interesting

shall

will

complex

idea

problem

for

gets

and

coopera-

results
an

probability

eventually

application

the

philosophers
solution

philosopher

([11]

control
His

built

which

it

be

distributed

are

in
are

Recently

here

dining

used

which

applied

present

probabilistic

guarantees,

hungry

has

systems.
We

been

algorithms

concurrency

provably

processes

reader

can

algorithms

problem.

but

as

The

algorithm

has

time,
can

we

is

rent

memory

philosopher

idea

first

probability

which

fully

central

deterministic

author
of

elsewhere.

which

the
same

second

problems

appear
of

the

the

field

adversary

probabilistic

provide

than
solve

[101,

fields
efficient

known

of

algorithms,

system
and
is

which

processors

with

that

Introduction

notion

be

processors.

bilistic

1.

operating

probability

the

problem

istic

free-

communicate.

was

high

ministic

probability

here
any

the

some

guarantee

(with

an

to

probabilistic

the
On

eat

of

to

processes

processors

there

given

proposed

not

a
(in

guarantee

idea

For

is

progranuned

them

will

does

It

are

program

with

demonstra-

starvation).

circumstances

and

any

may

The

distributed

as

be

philosophers

philosopher

is

the

seems

suited

can

hypotheses,

can

(general

the

choice
hungry

This

natural

so

deadlock

that

problem.

certain

and

probabilistic

processors,

behaviors

former.

fashion)
of

every

the

proba-

powerful

deterministic

useful

philosophers

deterministic
absence
other

of

of

more

philosophers

under
the

systems

essentially

systems

there

be

distributed

processors

well

the

processes
our

the
be

proto-

problem
useful

and
to

concurrency

asynchronous

processes.

2.

In

The

[3]

current

E.

Dining

Dijkstra

as

sophers

which

problem.

much

on

account

cause

it

is

rency

control

problem

since

problem

its

practical

paradigm

for

in

then,

problem,

This
of

has,

classical

communicate

Problem

proposed

programming

considered

Philosophers

the
is

not
but

class

of

directly

represented

by

passive

ies)

may

be

accessed

only

N.

Francez

and

M.

and

remarked

which

considered

philo

interesting

large

other

are

philosophers.

been

dining

importance

con-

each

chopsticks

the

so

[7]

and

problem

then

in

philosophers
The

of

ing.

When

with

it

her

may

too
bowl

of

and

which

eat

he

But

and

neighbor.

left

chopsticks

as

ously

he

in

the

cannot

it

If

philosopher

hungry

sticks

at

his

the

chopsticks

each

time

the

to

he

eats

tocols

already

would

down

both

his

initely
and

more

precise

through
so

on

ad

exclusive
with

while

he

a
is

To

to

two

neighbor.

osopher

goes

indef-

problem

for

the

eating

some

other

is

to

which

is

die

only

may

entities,

which

above

(especially

chopstick

is

at

ensu~e

in

that,

ing,

not

one

varying

be

of

will

one,

system

able
but

hand)

and

several

the
time

Properties

the

We

shall

of

now

describe

solutions

constraints

we

will

practical

be

some

are

justified

to
both

the

system

in

which
to

first

there
which

Indeedr
active

is
every

we
agents

is

distributed

are

no

central

other

memory

process

looking
are

that

the

we

systems,

phil-

not

talk-

rates

solu-

on

the

the

for

may
systems

philosophers

or

in
who

which
in

have

process

in

the
the
;

Section
of

short,

the

we

systems

pro-

values
In

such

of

are

simple

only

(not

necessarily

phil-

we

will

say
such

build

non-starvation
is

some

hungry

later

Plato)

not

time
will

will

words,

that

shall

exhibit

property

other

ex-

hungry

then
shall

at

this

guarantees

to

every

there

then

enjoys

philosophers

weaker

Plato,

philoso-

the

we

time,

the

constraints

eat,

step

any

for

two

that

to

first

at

on

the

assuming
of

a
all

not

134

assumptions

the

eat.

be

said

to

deadlock-free
hungry

philo-

the

the

eating,

example,
by

awaking

is

eating.

to

make

including
by
and

the

in

uler,

though,

about

the

of

all

result
the

an
the

([41
is

when
this

the
extremely

not
of

allowed
future

one

of

shared

the

make
This

random

the
pervari-

variables

each

here
Other

less

adversary
use

of

assumption

presented

to

his

ab~ut
draws

properties.

Plato
of

random

severe

protocols

[11])

keep

adversary

private

situations,
and

to

information

correctness

different

scheduler

best

of

or

therefore,

adversary

values

of

respective

not,

only

the

that

results

him

use

is

strong

an
his

allow

value

ensures

of
do

are

philosophers,

may

We

processes,

This

very

We

syn-

We

the

different

possibility
for

the

processors.

concerning
of

scheduling.

would,

concerning

different

anything
activity

overall

works,

only

our

of

assumptions

which

In

word

formed

access.

do

in

starve.

system,

and

systems

central

have

such

different

(or

initial

We

enjoys

which

scheduler

Such

interested
,

variafor

philosophers)

allow

gets

as

only

from

aesthetic

are

i.e.

symmephilo-

shared
not

variables

the

is

deadlock-free.

ables

constraint

truly

are

code

protocols

will

say

system

considerations.

Our

find

lockout-free.

protocol.

only

to

distributed

to

and

chronization

consider.
by

our

all

were

easy

can

restrict

all

it

the

satisfy

if,

sophers

Solutions

constraints

willing

is

above

neighbors

class

whom

way

be
and

of

(assume
of

which

favorable.

large

that

identifi-

philosophers

if

of

fact,
an

also

described

job
are

eventually

exclude

and

the

philosopher

who
Constraints

in

and

different

will

is

system

tions.

3.

be

different

which

some

will

will

problems

would

natural
number

beginning,

If

those

But

each

strength,
we

We

all
the

philosopher

state

the

philosopher,

proto-

which

of
Thus

eat.

of

any

same
value.

to

property:

possibly

in

at

degrees
to

of
and

behave

that

most

with

will

chopsticks

indicated

osophers

describe

very

each

the

of

goal

it

system

needs

philosophers,

in

that
this

large

simple,

states

If

be
The

bits)

shared

do

very

each

the

system.

thinking.

cols

to

the

is

call

remember

of

in

plained

chopsticks.

philosopher

is

[6].

impose

is

the

which

eat.

of

which

CSP

This

for

Our

his

each

scheduler

processors.

phers

chop-

philosopher

resources

[3],

the

trying,

eat

of

[2],

solution

could

values

identical

up

releasing

philosopher

thinking,

cycle:

infinitum.

access

shared

way

none

[1],

philosophers.

philosophers,

same

variables

that
In

recently

that

criterion.

configurations

it

interested

to
pick

his

(without

in
the

also

shared

that,

similar

starves.
both

have

g.,

we

possibly

logn

assumption,

initial

of

(memoradjacent

central

(we

so

initial

are

initial

of

personal

assume

protocols

and
many

philosopher

satisfies

puts

an

think

than
than

hold

obvi-

hand

hold

bles

is

and

philosopher

gets
time,

and

in

that

even

to

sophers

the

philosopher

to

fewer

we

tries

not

attention

him

is

Rodeh

language

philosophers,

more

tric:

adjacent

he

the

hold

as

time

the

view).

we

number,

have

only

hungry

both

cation
we

To

philo-

which
a

if

eventually

needs

get

same

chopsticks),

material

at

be

could

in

between
are

chopstick

to

they

(there

adjacent

located

then

pick

just

two

If

simple

him.

neighbor

there

happens

neighbor,

right,

to

the

identical
of

if

very

full

to

point

from

table.

try

of

which

two

this
of

propose

constraint
be

assumption

essentially

philosophers.

up

example,

appropriate
a

is

neighbor.

eventually

his

chopstick

pick
a

closest

right

all,

are
one

then

are

second

laymans

inter-

from

the
is

will

any

one
In

of

chopstick

his

between

cannot

for

at

and

up

hand

him,
a

located

there

pick

He

maintains
of

(wisdom

another

eat

[4]
in

philosophers

time,

hungry

to

middle

which

him

sophers)

the

chopsticks

is

his

wants

to

Rodeh

the

(e.

kind

in

cells

of

think-

not

time

benefactor

in

chopstick

only

kind

of

does

from
gets

then

tale)

between
one

may

chopsticks

chopstick

she
,

number

far

eating

distributed,

table.

mainly

philosopher
He

this

two

middle
only

two

in

the

One

thinks,

circular

consists

located

needs

some

and

by

satisfied

use
the

and

truly

informally

Suppose

way.

colleagues.

which

is

first

around

philosopher

thinking.

oriental
up

precise
sitting

that

foodr

presented

philosopher

happen

much

be

more
are

life

act

will

so

[8])

all

regulates

Francez
The

and

they

which

problems.

published

[6],

Indeed,

concur-

constraint

solutions

[5],

be-

this

with

severe
sched-

information
draws.

We

have

to

allow

ler

for

the

because

we

philosophers
part

that

of

not

an

know

is

to

We

access

ble)

assume

common

that

other

words,

nizing

the
to

fication

for

time

of

either
taken

of

accesses
conflicts

care

of
that

orders
is

of

that

say,

is

ing

is

to

eat.

of

hours.

rates,

system

will

terms
to

meal

of
The

at

the

is

computations,

of

mentation,

CSP

tics

of

Such

posed

in

are

therefore

being

that

up.

putting
a

of

in

the

or

of

seen

chopstick

and

down

which

to

third

choice

of

the

be

of

Deterministic

very
is

simple

no

constraints
phers

to

actual

systems

that

mentioned
are

above,

deterministic

in

1.

free,
the

is

no

distributed

dining

and

philosophers

propose
In

while

~ibuted
fine
eat,
may

and
a

showing

themselves
scheduler

in

this

do

do

the
is

philosophers
an

external
are

will

that

or

trying

do

draw

if

by

then

pick

not

in

cyclic
and

aware

activate

of
each

their

semanone.

CSP

is

pKo-

following:

since

shall

of

the

of

is

we

need

the
a

incorporate

free

individual

philo-

probability
the

way

ensure

symmetry

will

be

process

for

the

each

function

philoR

is

{Right,Left}.

philoso-

die

random

element

equal

until

od;

of

{Right,Left};
***

chopstick

and
then
lift

R(s)
chopstick
lift

probabilities
is

down

it;
is

down

it;

trying:=false
else
put

down

chopstick

fi
g;

13
the

14

eat;

15

put

down
both
one
at

chopsticks
time,

in

an

arbitrary

order

***

od
.

deadlocksolution

Definition.

to

We
no
no

such

de-

action.

from

mean

and
let
1

philosopher

the
be

active,

Under

past

the

complete
draws

S,

for

to

every

philosophers,

is

past

of

Pi

philosopher
i.e.

to

behavior

their

whose

perform
up

sequence
with

behavior

to

of

an
any

given

atomic

results,

turn

atomic
time,

actions
up

to

that

n
Following

The

name).
for

to

random

philosophers
own

assigns

time.

us
to

schedule

which

philosophers,
next

we

to

solution
sake,

order
the

shall

philosopher

function

is

truly

proofs

naming

We

on

trying:=true
Zile

and

the

imple-

think;

***

allow

For

the

solution

below,

function

wait

that

the

solution.

manner

an

(for

Algorithm

following

program

deterministic,

will

deadlock-free.

number
(this

which

such

of

the

one,

the

the

satisfying

symmetric

symmetric

scheduler

be

is

this

probability

recurring,

laws

***with

problem.

there

of

true

the
Suppose

Proof.

is

keep

the

11

deterministic,

deterministic

probability

processes.

There

truly

idea

any

protocols

reflection

16
Theorem

with

our

symmetry.
the

letting

and
up

show

which

in

Philosophers

could

of

expressed

now

and,

Free

of

this

with

the

apply

table

problem,

protocols

proof

programs
only

and

implementation

probabilistic

The

into

We

variable.

will
the

CSP

formal

implementation

gist

sopher.

Solutions

argument

solution

the

seems

fact,

[4].

12

there

this

with

terminate

10
4.

[9]

actions,
our

neighbor,

shared

notice

terminating

determin-

Lamport

distributed

probabilistic

break

of

an

be

distributed
L.

we

contradic-

broken.

men-

picking

will

to

truly

be

CSP)

truly

Francez

claim

apparent

constitutes

any

by
the

this

CSP.

together

[4],

which

that,

may

practice

the

of

lifetime

to

risk

the

no

first

even

sophers,

will-

assuming

on

later

be

details

proposed

contradict
to

of

the

must

The

symmetry

without

disturbing
is

be

value

in

move

chopstick

will

down

change

one

by
a

As

justified
in

disturbed

check
it

may,

again

Full

round.

to

is

problem,,with

4
We

beginning

elsewhere.

solution

above,

in

the

systems.

philosopher

the
will

the

The

on.

symmetric

are

philoso-

the

for

of

there

in

the

atomic

claim

end

then
philososo

is
at

configuration

seems

The

or

the

in
of

to

and

philosophers

the

n,
the

turn,

solution

[4]

Thus

nanosecond.

previously

millions

about

to

which

one

he

participating

many

in

5.

say,

assume

in
in

appear

been

fact.

are

therefore

one
may

proposed

(only
a

before

last
we

Theorem

justi-

we

The

failures

all

the

that

have

of

smaller

is,

order

configuration

implementation

to

of

ideas,

of

is

the

deterministic

different

say,

which

istic

assume

activation

philosopher

are

unending

actual

each

process

we

fix

millisecond.

Since,

perform

of

activity

which

each

properties

also

number

itself

order

in

is

In

they

variable

of

a
,

between

for

system

on

tion

The

the

may

The

interest)

of

made.

with

that

four

slices.

rate

time

get

tioned

the

second.

eventually
the

of

order

suffer

To

time

just

Therefore

with

action

are

needed

to

the

of

atomic

the

time
of

the

dealing

idle
of

the

order

of

hardware.

are

one

the

is,

the

we

varia-

length

we

to
then

Rodeh

The

or

the
round

activated
if

respect

and

writing

and

are

round,

the

two)

the

occur,

n
that,

will

synchro-

compared

small

not

by

the

second

very

to

proof

it.

of
only

philosopher.

do

of

access

to

solved.

small

is

in

similar

the

requests

that

claim

never

the

(reading,

very

is

variables

pher:

magnitude
of

shared
The

of

is

phers

action

at

at

access

is

another

philo-

to

(here,

atomic

repeat

symmetric

will

problem

action
is

that

assuming

the

single

with
we

adjacent

that

number

atomic

This

exactly

get

variable

writing)

activity

density

do

design:

access

assumption

byan
and

rate

of
shared

this

taken

reading

two

theirs

that

we

study.

system

philosophers,

of

assume

by

both

visible

which

certain.

philosopher

access

processes

is

eventually

we

the

to
of

exclusive

every
will

only

willing

shared

schedubetween

relations

worst

that

have

variable

not

variable

(they

are

principle
the

variables

and

to

that

use

time

are

adversary

interactions

complex

sound

and
a

same

and

an

the

describe

of

very

assume

sophers

of
that

we

iceberg

about

also

are

possibility
assume

fixed

mapping

135

sequence
which

[11],
of
makes

for

us

activations
the

next

schedule
but,
action

is

not

rather,
depend

merely
is

on

a
the

whole

past

for

any

pends

on

whole

of

the

resources,

as

draws

history

past

what

Plato

shared

happened

we
of

the

of

the

of

elements

given

random

draws
of

particular
infinite

Lemma

C =

of

the

the

atomic

that

we

exactly

which

at

same

time

the
easily

same

this

as

the

to
Note

i.

take

of

not

place

of

of

from

concern

proper
infinite

in

C,

number
if,

random

of

for

every

draws,

explanations

lemma

for

this

quits

while

to

space

of

trying

of

and

the

the
is

is
of

event

it

should

to

those

following

probabilof

times.

that

the

times

has
in

only

positive

for

probability

be

understood

that
Proofs

schedules.

lemmas

event

described

meaningful

attach

only

the

lemma

infinite

chopstick

with

number

and

number

claim

which

an
up

then,

to

The

and

chopstick

infinite

relative

applies

2.

In

sopher

picks

times,

with

deadlocked

up

are

omitted.

computation,

chopstick

an

probability

is
COM(S,

eat,

then,

D),

no

eating,

Let

and

Aristotle

draw

was

every

infinite

philo-

number

of

one.

be

such

Left

are

ity

not

or

Aristotle

finite

that,

are

trying

and

Aristotles

Consider

all

of

times

in

C,

no

later

one

in

F.

To

each

eat,

in

two

F.
at

or

his

last

random

random

draw

was

at

with

least

one

least

probabilof

one

random

draws

Then,

just

last

random

Plato

Platos

chopstick

C,

consisting
both

computations

half:

up

after

than

to

t,

(infinite)

picks

eat

time

of

than

to

computation

at

last

continuations
less

number

draw

or

steps,

which

after

proper

3.

of

Right.

the

found
S

schedule

computation

possible

if,

proper

the

next

exactly

proper.

the
if

is
an

called

is

D)

that,

philosopher

is

outcomes

follows

program,

activated

philosophers,

seated

picks

infinite

hypotheses,

the

times,

an

an

schedules

Lemma

actions
do

two
is

place

restriction

they

meaning

one

the

of

exact
eating

up

Aristotle

eats

hypotheses.

those
is

picks
but

number

probability

finite

take

Plato

Plato

Plato

atomic

time

atomic

to

COM(S,

every

long

computation
is

computation

It

at

to

Plato

Aristotle.

finite

Lemma

schedule

sequence

C;

a
life-

actions

allow

variables,

philosopher

times.

place

in

of

The

that

term

refer

where

times

one,

of

an

total

computation

atomic

to
as

the

If

of

a
is

Note
the

lemmas

of

1.

ity

time.

Definition.
every

two

lifted

shared
same

get

which

sequence

takes

no

we

use

of

that

processes,

the

in

finite

element

action

different

the

shall

assume

be

the

ith

sequence

embodies

We

denote

The

infinite

actions.

and

system.

an

outcomes

COM(S,D),

atomic

unending

to

actions.

could

of

is

is

specific

{Right,Left}),

set

sequence

computation

at

the

and

(D

computation

computation
span

schedule

O.

Aristotle,

left

number

made.

do

random

only
For

DL(S)

following

and

to

inter-

[11],

S,

The

and
to

results

schedule

de-

successes

has

the

that,

next

access

Unlike

history

idea

happen

gain

processes.

past

already

of

on

the

will

to

as

the

under

what

processes
well

within

include

captures

system,

the

failures

nally

This

behavior.

specific

of

them

draw

after

Plato

finite

in

his

gets
F

and

last

random

exiting.

On

the
D

draws

we

every

impose

The

function
S

space

of

of

computations

all

of

the

set

that

is

sequel

that

it

is

associates

with

of
E.

we

shall

of

as

random

on

the

the

are

disjoint

and

B,

an

Our

proper.

no

assumption

theorems,

on

thus,

S,

ensure

certain
properties
hold
for
every
individual
We do not
assume
a probability
proper
schedule.
distribution
on the
space
of schedules.
Our

goal

is

to

show
a

probability
the

We

zero.

events

in

that,

in

deadlock

the

may

shall

system

occur

first

of

only

define

4.

putation

for

at

at

which

but

after

Pi

is

if

there

to

eat,

there

which

no

exists
and

For
a

actually

starving)

time

which

DL(S)

at

never

Pr(D

want

to

:
prove

left

com-

will

arise,

tion

B,

to

a
the
is

C=COM(S,D)
for

consay

configuration
has,

that
B,

between

draw.

philosopher
of
last

with

and

random

draws

probability

disjoint

if,

one,

from

A,

last

random

draw

is

Left

random

draw

is

Right.

We

get

to

For

every

now

picks

times,

last

in

the

main

time

is

his

t,

then

the
there

later

configura-

some

philosophers

right

theorem

chopstick

A,

which

while

up
at

neighbors

concerning

the

philosophers.

2.

We

time,

Lemma

to

eat,

of

philosopher

is

proper

schedule

2,

4,

trying

an
there

nite

the

event

of

S,

deadlocked)

pher

eats

tlie
.

event

computations

proper

136

deadlock

one
,

DL(S)

of

,..

An

one.
of

We

and
have

deadlocked
have
may

occur

to

An+2,

Lemma
philoso-

every

that,

one.
with

infi-

last

of

n,

relative

computations,

only

Lemma

an

some

for

shown

By

of

3,

event
per-

one,

Lemma

probability

the

draws.

hypotheses

BY

the
By

philosopher

configurations

between

(relative

random

the

.,An...

about

deadlock.

probability

disjoint

satisfying

Al

contradiction.

talk
a

every

of

with

by

then
to

computation)
number

draws
AO,

may

relative

arise,

sequence

theorem

We

probability

infinite

probability

defined

reader).

every

with

will

say

the

>0.

events

deadlocked

forms
C,

prove

DL(S)
of

random

well

shall

that

probability

in

computation
Pi

S,
has

that,

random

every

of

Theorem

eats.

schedule

is

is

trying

which

computation
proof

point
is

in

Pi

proper

(the

eats.

(or

deadlocked

probability
Denote

fixed

philosopher

a
after

exists
philosopher

later

a
shall

precisely

computation

one

locked-out

being

We

which
least

If

Proof.

deadlocked

We

philosopher

number

Assume
A

corresponds

draws.

the

with

question.

Definition.

and

each

performed

infinite

free

philosophers,

if

there

random
A,

configuration

make

instant

latest

configuration,

Lemma

such

that

free

of

set

probability

draws

time

figuration

distri-

probability

in

random

distribution

defined

sequences

the

except

then

probability

being

of

of

probability

COM
a

outcomes

uniform

computations,the

COM(S,D)

In

possible

the

schedule

bution.

all

3:

with
to

non-deadlocked
We

probability

conclude
zero.QED

that

O.

6.

Lockouts

are

Possible

while

do

As

indicated

in

a lockout-free
system
proposed
The
Theorem
3.
not
lockout-free.
C.A.R.

the
is

system

Hoare

introduction
may be

It

system.
above

not

of

[5]

free

is

a measure

of

g;

while

draw

schedule

14
15

practice,

we

probability

shall

one,

show

that

starve

all

but

Theorem

one,

For

4.
is

the

system

schedule

n-1

of

which

free

philo-

philosophers,

starves,

with

wait

previous

of

Theorem

of

philosophers

reasoning

would

chain
will

theorem

get

to

throws

had

to

succeed

be
in

light

on

delicate.

showing

sitting

why

No
that

next

to

the

one

of

each

other

eat.

shall

now

guarantees
be

no

offer
with

that,

The

solution

probability

i.e,

lockout,

7.

another

nobody

Courteous

which

one,

will

possibility

Section
may

6
be

is

due

(on
to

eat

neighbors
values

to

s-last

s)

and
then
li~

R(s)
chopstick

16

if

17

then

6),

even

and

Pi

has

recent

the

variables

philosophers,

we

obtain

lockout-free

sopher

is

defined

var

if

ensure

the

***

when

***

Off

only

after

***

The

left

neighbor

one

***

change

***

He

becomes

to

hungry

and

a~onal

put

it

set

On

s~etrically

it

as

to

but

not

right-neighbor-signal

for

left-signal:=Off;

right-signal:=Off;

left-last:=Right;

right-last:=Left;

26

put

down

var
:

of

the

that

while
a

right

left-last,right-last

***

left-last

***

both

***

It

***

stick

is

left

may

change

indicates
or

shared

his

neighbors

meal.

for

our

proof.

neighbors

ate
from

***

initially

on

Neutral.

***

Left-last

is

the

***

right-last.

same

time

be

other

an

natural

the

meals,

This

with

we

local

are

suffices

here

for

concurrent

appropriate

to

followed

ordering

of

out

to
able

or

used

systems

in
turns

way

preceded

methodology
in

ordering
It

immediate

meal

useful,

proces-

modifications,

contexts.

philosopher

following

sequence

chopstick

(line

eats
of

he

picking

up

(line

17),

setting

his

left-last

(line

25),

setting

his

right-last

(line

25),

and

putting

(line

26).

If,

while

(line

***

first

of

***

shall

say

[tl,t2]

his

(this

both

Left

sequence
his

puts

releases

corresponding

Right
to

up

and

first

chopstick
to

the

tl

he

chopsticks

picks

time

implies

second

his

performing

chopsticks

that

the

up

variable

philosopher
at

through

variable

down

17)

the

goes
picking

actions:

15),

chopstick

second

down

at

the

time

t2,

we

meal-interval

is

tl<t2).

***
We

Definition.

***
***

left

neighbor

and

it.
who

***

philosophers.

on

The

with
may

no

order

philosophers

***

shall

say

meal-interval

that

mealinterval

([tl,

[t3,t41

[tl,t2]

t21 <[t3rt41)

t2<t3.

last

left

from

chopstick.

It

as

neighbors

left

is

1.

***
***

The

2.
between

only

philosopher

***
***

tl
who

right-last

variables

chopsticks

during
ever

holds

both

t2

Platos

is

antireflexive

and

his

If,

his

Plato

computation

of

Plato,

is

the

left-last

holds
of

last

time

both
and

variables

and

therefore

is
to

Plato
Platos

interval

variable

in

to

(since

variable

right-last

t2,

access

chopsticks)

left-last

3.

meal-interval

time

this

changes

his

and
has

and

Remark

137

is

time

his

he
***
***

precedes

[tl,t2]

If

then

philosopher

chop-***

relation

transitive.

Remark

{Left,Neutral,Right};

with

right

order

requires

the

is

Remark

is

any

,right-neighbor

signal.

var

in

proof

global

above,

{Roff};

Left-neighbor-signal

time

of

there

when

and

***
***

meals

described

***

right-signal.

left-neighbor-signal

chopsticks

at

following

time

if
only

both

one

od
.

precedes
read

signal

chopstick

25

***

***
to

24

When

***
to

it.

refers

down

and
philo-

neighbor.
iS

restored

read

=false

eat;

in

eating.
may

down

neighboring

left
and

is

23

ses

his

{On,Off};

Off

chopstick

fi

dealing

process.

with

set

is

courteous

following

shared

initially

Pi

behavior

The

Off

it;

trying:

say

neighbors

after

using
by

:
is

is

eaten

courteous

Ieft-signal,right-signal

It

his

neighbor

alread
By

in

philosopher
up

that

shared

by

Left-signal

pick

system.

***

***

that

meal.

can

***

lift

else

The

demonstrated

to

line

most
for

fact

enough

s-neighbor-signal

will

Algorithm

lockouts

the

discourteous

chopstick
trying

for

down

Neutral

define
The

is

starve.

Philosophers

chopstick

s-last

27

there

***
We

{Right,Left};
***

or

22

local

of

13

20

12

19

philosophers.

The

until

18

probability

element

equalprobabilities

and

21

proof

random
with

11

sopher.

there

a
***

the

one

in

trying

do

factory

right-signal:=On

die

10

with

left-signal:=On;
or

quality
of a solution
to the
dining
philosophers
the
size
of the
longest
chain
of starving
problem:
Though
it
is possible
philosophers
that
may occur.
that
the protocols
proposed
above
are quite
satismay,

trying:=true

philosophers

proposed

do

lockout-free.

the

has

one would
like
shown that
the

true

think;

equal

no
unless

at

time

to

Right

t2]

is

Left.

C,

[tl,

meal-interval
of

of

Plato

then

and

either

[tl,

philosopher

(since
hazds

during

neighbors
at

[t3,

is

computation

The

solution

question

of

proper

to

particular

the

in

vior

of

tion

for
to

be

Here

the

even

though

problem

the

general

which
as

seems

in

must

be
a

reliability

of

the

component

irreproducible

beha-

necessary

claimed

have

to

illustrated

reproducible

is

themselves

totally

to

as

they

guaranteed
have

lockout-free.

system

philosophers

the

it

reliable,

behavior.

is

one,

and

which

two
in

for

approach

advocated

components

no

probability

D)

dining
an

There,
is

Berkeley,

t2]

in

with

methodology

[11.

debugging

systems

the

prevalent

programs

[tl,

Conclusions

suggests

to

<

chopsticks

schedule

COM(S,

programming

opposed

t4]

his,and

their

then,
c

here

[t3,

chopsticks

condi-

that,

for

built

out

of

reproducible
the

system

is

processes

may

behavior.

References

[1]

Brinch

Hansen,

Prentice-Hall

[2]

Brinch

[3]

Hansen,

P.

programming

Dijkstra,

Distributed

processes,

concept.

E.W.

processes,

Academic

CACM

Hierarchical

Operating

Press

21,

11

con-

(November

[4]

Francezr

N.

type

implemented

tion

scheme.

April

1980

and

Rodeh,

Hoare,

of

sequen-

Techniques,

at

Oct.

abstract
communicaCenter

21st

TR-080,

Annual

Symposium

1980).

Towards

Operating

distributed

Scientific

presented

C.A.R.

probabilistic

Israel

be
Syracuse

programming,

M.

by

I.B.M.
(to

F.O.C.S.

ordering

Systems

1972.

data

[5]

Principles.

tial

on

Systems

1973.

current
1978)

Operating

P.

theory

Systems

of

parallel

Techniques,

quoted

above.

[6]

Hearer

ses.

[7]

CACM

Holt,

Scott,

R.

21,

R. C.,
M.A.

operating

[8]

C.A.

Graham,

systems

Kaubisch,

[9]

[10]

Lamport,

Rabin,

ficial

W. H.,

L.

L.

Private

[111

Rabin,

Annual

1978.

C.A.

R.

Experience,

to

arti-

74

615-619.

synchronization

variable,
fuer

21St

with

1978.

Processing

pp.

N-process

shared

Forschungsinstitut
1980,

ed.)r

and

Hearer
and

impediments

Information

M.O.

and

communication,

Theoretical

Rosenfeld

4.logN-valued

March

R. H.,
Software

341-356.

M.O.

E.D.,

Addison-Wesley

Perrotr

Pp.

prOces-

programming

applications,

intelligence,

(Jack

Lazowska,

concurrent

programming.

6 1976,

sequential

1978).

G.S.,

Structured

Quasiparallel
Vol.

Communicating
(August

mathematik,
F.O.C.S.

Technical
ETH
Symposium

by
Report
Zuerich,
(1980)

Rabin,

Memorandum

Aristotle,

philosophers,

presented

or

[12]

meal-interval
of

his

both

time)

of

have

8.

be

t4]
both

meal-interval

If

5.

<

[t3,t4]
meal-interval

has

same

courteous

one,

each

the

Theorem
of

and

t2]

any
may

hands

Plato

[t3rt4]

138

M.O.
No.
August

The
UCB/ERL
1980.

choice
M80/38,

coordination
Univ.

problem
of

Calif.

Potrebbero piacerti anche