0 4 1 3 2 No deterministic symmetric dining solution [RL81] - - PDF document

0 4 1 3 2
SMART_READER_LITE
LIVE PREVIEW

0 4 1 3 2 No deterministic symmetric dining solution [RL81] - - PDF document

Once up on a time ... [Dij71] 0 4 1 3 2 No deterministic symmetric dining solution [RL81] Probabilistic symmetric solution T raditional non-symmetric: Left-Righ t solution Generalized dining philosophers [Lyn81] . . .


slide-1
SLIDE 1

1 2 3 4

Once up
  • n
a time ... [Dij71] T raditional non-symmetric: Left-Righ t solution [RL81] Probabilistic symmetric solution No deterministic symmetric dining solution
slide-2
SLIDE 2

. . . . . . . . .

Now: following:

Generalized dining philosophers [Lyn81]
  • Eac
h philosopher has an arbitrary n um b er
  • f
neigh b
  • urs
  • 9
  • ne
fork b et w een ev ery pair
  • f
neigh b
  • urs
  • Eac
h philosopher needs all adjacen t forks to eat
  • Requiremen
ts: Exclusion: Disallo w neigh b
  • urs
to eat sim ultaneously + no deadlo c k, no starv ation Conict graph,
  • =
degree
slide-3
SLIDE 3
slide-4
SLIDE 4

. . . . . . . . .

i need these bottles hick!

  • 9
  • ne
b
  • ttle
b et w een eac h pair
  • f
neigh b
  • urs
Drinking philosophers [CM84]
  • Eac
h thirst y philosopher needs a (presp ecied) subset
  • Requiremen
ts: pro vided that they need to drink from dieren t (presp ecied) b
  • ttles
(ma y dier eac h time)
  • f
its inciden t b
  • ttles
to drink Exclusion: Allo w neigh b
  • urs
to drink sim ultaneously , + no deadlo c k, no starv ation
slide-5
SLIDE 5
slide-6
SLIDE 6
  • Mobile
Philosophers [GPT96] Channel (F requency) Allo cation base station user (philosopher), mobile host
  • F
requency sp ectrum same in eac h cell
  • Eac
h philosopher needs some (arbitrary , not presp ecied) subset
  • f
frequencies to comm unicate
  • Requiremen
ts: p
  • ssible
for neigh b
  • urs
to
  • p
erate sim ultaneously
  • Request
satisabilit y (Bandwidth Utilisation) Exclusion: Allo w c hoice
  • f
frequencies so as to mak e it + no deadlo c k, no starv ation
slide-7
SLIDE 7 General Requiremen ts Dieren t constrain ts and exibilit y for eac h v ersion No deadlo c k Ev aluation Criteria No starv ation Time and comm unication complexit y (to satisfy a request) F ailure lo calit y [CS92] F ault tolerance (units dep end
  • n
the comm unication system) Exclusion Request Satisabilit y (for mobile philosophers)
slide-8
SLIDE 8

. . . . . . . . . . . . . . .

then w ait for .... then w ait for .... Generalized Left-Righ t Dining [Lyn81] p iC +1 , eating pic k ed b y p i Idea: Color resources (edge-color conict graph), C colors p i pic ks forks in increasing color
  • rder
(using m utex for eac h) color
  • rder
guaran tees no deadlo c k, no starv ation Pro cess w aiting c hains = also failure lo calit y max-length = C w ait for fork color 1 pic k ed b y then w ait for .... w ait for p i(C 1) w ait for fork color C p iC pic k ed b y T ree giv es w
  • rst
case w aiting exp
  • nen
tial in C fork color C p i1
slide-9
SLIDE 9 Restricting the w aiting c hain length [SP88] Idea: again pic ks forks in increasing color
  • rder
(using m utex for eac h) but no w: if p i pic k ed color 1, 2, . . . x=2, . . . need to w ait for color x max-w aiting-c hain-length = log C (= also failure lo calit y) in addition: sync hronization do
  • rw
a y collect forks w ait for p ermission b y eac h
  • f
the neigh b
  • urs
to cross Time, comm unication complexit y = O ( log C ) bac ktrac k (release forks bac k to x=2)
slide-10
SLIDE 10 Wh y pic k forks 1-b y-1? Another approac h [CM84] Idea:
  • Initial
Acyclic Orien tation
  • Sink-no
des can eat; then
  • Rev
erse inciden t-edge-direction (send priviledges) using initial lab eling (e.g. no de coloring) and priviledge tok ens Result: (more
  • n
acyclic
  • rien
tations in [AST94], [BG94]) dynamic priorit y resolution sc heme can e.g. resolv e p
  • ssible
conicts in the drinking solution W aiting c hain length = O(n) (= failure lo calit y also)
slide-11
SLIDE 11 Conict
  • Precedence
Graph Undirected graph in which edges rep resent sha red resources b et w een p ro cesses w e call this graph conflict graph The algo rithm b y Chandy and Misra resolves conicts b y dening fo r every p
  • ssible
conict a p recedence relation
  • When
t w
  • p
ro cesses comp ete fo r a resource the
  • ne
with higher p recedence ma y access the resource rst
  • In
  • rder
to receive a solution which is fair these p recedences will have to change dynamically
  • The
directed graph graph that changes dynamically is called p recedence graph F
  • r
each resource an edge
  • f
the p recedence graph is directed from p ro cesses with lo w er p recedence to p ro cesses with higher p recedence
  • T
yp eset b y F
  • il
T E X
slide-12
SLIDE 12 The p recedences
  • f
the graph a re chosen such that it is alw a ys p
  • ssible
to distinguish at least
  • ne
p ro cess from all
  • ther
p ro cesses ie this p ro cess can enter its critical section NO DEADLOCK This is ensured b y the existence
  • f
at least
  • ne
p ro cess which has higher p recedence fo r all its sha red resources A p ro cess with this p rop ert y is called sink Its existence is gua ranteed when the p recedence graph is alw a ys acyclic By changing directions
  • f
edges it is p
  • ssible
to change the p recedences dynamically
  • This
must happ en in a w a y that the p recedence graph sta ys acyclic so p rogress fairness and mutual exclusion is gua ranteed
  • T
yp eset b y F
  • il
T E X
slide-13
SLIDE 13 Sta rting with a D A G
  • The
graph is initialised acyclic fo r example b y a no de colouring algo rithm
  • The
graph can remain acyclic if after use
  • f
the critical section a p ro cess reverse all adjacent p recedences in
  • ne
step
  • Need
a mechanism to k eep the sense
  • f
direction
  • T
yp eset b y F
  • il
T E X
slide-14
SLIDE 14 The mechanism F
  • rks
which have the p rop ert y to b e either clean
  • r
dirt y
  • A
fo rk will b e cleanedb efo re it is send to a neighb
  • ur
p ro cess
  • A
clean fo rk will b ecome dirt y when the holder
  • f
the resource enters the critical section
  • After
use it remains dir ty until it is sent to a neighb
  • ur
p ro cess
  • T
yp eset b y F
  • il
T E X
slide-15
SLIDE 15 The dynamic D A G
  • The
resp ective p recedence graph H can b e dened in the follo wing w a y
  • F
  • r
all pairs
  • f
p ro cesses p and q which sha re a common resource pq
  • ne
  • f
the follo wing statements is true
  • p
holds the fo rk fo r the resource and the fo rk is clean
  • q
holds the fo rk fo r the resource and the fo rk is dir ty
  • the
fo rk fo r the resource is in transit from q to p
  • T
yp eset b y F
  • il
T E X
slide-16
SLIDE 16 Requesting F
  • rks
The request
  • f
fo rks is realized b y request tok ens F
  • r
each fo rk there exist
  • ne
request tok en such that
  • nly
the holder
  • f
the request tok en can request a fo rk A hungry p ro cess requests a fo rk b y sending the request token to the
  • wner
  • f
the desired fo rk A p ro cess is not interested in accessing its resources when it holds a request token but not a fo rk
  • T
yp eset b y F
  • il
T E X
slide-17
SLIDE 17 The algo rithm The algo rithm is initialised b y an acyclic p recedence graph H and all p ro cesses with lo w er p recedence
  • wn
dirt y fo rks while p ro cesses with higher p recedence
  • wn
request tok ens All p ro cesses a re thinking ie they a re not interested in their resources A p ro cess which b ecomes hungry will send all its request token to neighb
  • ur
p ro cesses and w ait until it received all fo rks
  • A
p ro cess which received all fo rks will change its state to eating
  • A
p ro cess which leaves the critical section changes the state
  • f
all its fo rks to dir ty Then fo r all held request token the resp ective fo rk is sent to neighb
  • ur
p ro cesses The ab
  • ve
steps assume follo wing rules
  • T
yp eset b y F
  • il
T E X
slide-18
SLIDE 18 Receiving a request token fo r fo rk f
  • If
p ro cesso rs state is dierent from eating and f is dir ty then f will b e sent to the requesting p ro cesso r
  • If
p ro cesso rs state w as also hungry then the request token will also b e sent back Receiving a fo rk f
  • The
state
  • f
f will b e set to clean
  • T
yp eset b y F
  • il
T E X
slide-19
SLIDE 19 Co rrectness Mutual Exclusion Pro
  • f
The p recedence graph H is acyclic
  • No
Sta rvation Pro
  • f
Let the depth in H
  • f
any p ro cess p b e dened as the maximum numb er
  • f
edges along a path from p to another p ro cess without p redecesso r The p ro
  • f
will sho w b y induction that a p ro cess
  • f
depth k will eventually eat if p redecesso rs at depth k can ea t
  • T
yp eset b y F
  • il
T E X
slide-20
SLIDE 20 Complexities Communication Complexit y Odegree Pro
  • f
A p ro cess sends at most
  • ne
request token to each neighb
  • ur
and receives from each neighb
  • ur
at most
  • ne
fo rk
  • Tine
Complexit y On
  • T
yp eset b y F
  • il
T E X