Nothing Special   »   [go: up one dir, main page]

Knapp's Classification

Download as pdf or txt
Download as pdf or txt
You are on page 1of 6

3.

11 Knapp's Classification 2

All sites collectively cooperate Jo detect a cycle in the state graph that is likely to

be distributed over severat sites of thesystem


The algorithm can be initiated whenever a process is forced to waitt

TECHNICAL PUBLICATIONS An up thrust for knowledge


3-220 Distributed Mutex and Deadlock
Distmbutd Systems

T h e algorithm can be
initiated efther by the local site of the process or by the site
waits.
where the press
be detected by taking a snapshot of the system and
Distributed deadlocks
can
.

the condition of a deadlock.


evamining it for
be divided into four classes,
These algorithm can
a. Path-pushing: waiting node to blocking node.
Path info sent from Poss
i b l e was

b. Bdge-chasing: Probe messages are sent along graph edges Po>


GDiffusion computation: Echo messages are sent along graph edges
d. Global state detection : Sweep-out, sweep-in WFG construction and reduction
havn o Ka 1
3.11.1 Path-pushing
hownany valuus we

In path-pushing deadlock detection algorithms. information about the wait-for


dependencies is propagated in the form of paths.
Obermarck's algorithm for path propagalionis described here ie. an AND model.
I t is based on a databa[e model using transaction_processing Pan
Sites which detect a cycle in their partial WFG views convey the paths discovered
to members of the (totally ordered) transaction.
The highest priority transaction detects the deadlock "Ex => T1 => 12-}x"
Algorithm can detect phantoms due to its asynchronoussnapshotmethod.
ransuho?
alurtn
dead
oe

Features of Obermarck's algorithm dees


1. The nonlocal portion of the global Transaction Wait-For (TWF) graph at a site
is abstracted by a distinguished node which helps in determining potential dae
multisite deadlocks without requiring a huge-global TEF graph to be stored at
each site. Ioratio aivs
2. Transactions are totally ordered. It also ensures that exactly one transaction inn
each cycle detects the deadlock.

Algorithm
1. The site waits for deadlock-related information from other sites. e

2. The site combines the received information with its local TWF
graph to build
an
updated TWF graph.
Aloe
It then detects all cycles and breaks those
node 'Ex
only cycles which do not contain the

4. For all
cycles
'Ex Ti T2 Ex' which contain the node "Ex' the site transmits ,

them in string form 'Ex, Ti, T, Ex' to all other sites where an agent of T2 is
waiting for a resource being held by another transaction.
TECHNICAL PUBLICATIONS- An up thrust for knowledge
3- 21 Distributed Mutex and Deadlock

algorithm
reduces message traffic by lexically ordering transactions and
The
sending
the string Ex, T.
Ex' to other sites only if
T» T3, is higher than T3
T
lexical ordering.
in the
transaction detects the deadlock.
deadlock, the highest priority
.
For a
dapendsnbla,
dapeodnbla,
ex arkio .
exeud
eheck
Algorithms
511.2 Edge Chasing
denotes that the deadlock
U s e s a special
message known
as the ptobe (i,j,k)} (ij.k)
the process P and it is being sent by the home siteof
detection is initiated by
to the home site
of processP Proe
process P
travels
along the edges of the global TWF graph. A deadlock is
probe message
its|initiating)process.
detected if a probe message returnsjto that knows
for each process P, is maintained. If P
ABoolean array dependent,
G) is set to true. Otherwise it is false.
i s dependent it, dependent,
on
P1 initiates
Example: Consider given in Fig. 3.11.1. If process
system which
Proes deadlock detection, it sends probe (1, 3, 4) to $2 Since P6 is waiting
for P8 and
and (1, 7, 10) to $3 which in
turn
P7 is waiting
sends probe (
for
1,
P10. S2 sends probe ( 1, 6, 8)
9, 1) to
LauyciyoA.
S1. On receiving.probe ( 1, 9, 1), ^1
declares that P1 is

deadlocked.
PToL omto hd.
Protes moe
3
P1 launches

P10 Probe (1, 3, 4)

Probe (1, 9, 1) S1
ProbeT, 6, 8)
QP4
P8 inn
P9
P100
Probe (1, 7, 10) PT $2
$3
Fig. 3.11.1
S
Algorithm
then declare deadlock
IfPi is locally dependent
on itself
q f e value
such that
Else for all Pj and Pk and
upon Pj, oli
ffes.
So
Pi is locally dependent MON MgA
is waiting on Pk, and
Pj wi 3low
d
different sites,
Pj and Pk are on
site of Pk
to the home
Send probe(1j.k)

knowledge
thrust for
PUBLICATIONS An up
TECHNICAL

Lecltock oc
Distmbuted Systems 3- 22 Distributed Mutex and Deadlock
a c t i o n s - i n u a t ,

nb'ato auar
On receipt of probe(lj,k), the slte takes the followling actlons
If ndu
Pk is blocked, and ubu
dependentk(i) is false and u Cond qu
Pk has not
rlu uo u n e - >
replied to all requests of Pj,
then
begin
JocataP S6, a Van nuurnb

dependentk(i)=true; ~ 0 C
if k=I then declare
that Pi is deadlocked
else for all Pm and Pn such that u i docinu Va
Pk is locally dependent upon Pm, and e
Pm is waiting on Pn and
Pm and Pn are on different sites,
send probe(I,m.n) to the home sites of Pn
end

Mitchell-Meritt algorithm (an AND model) Ue labl

Propagates message in the reverse direction.


bel melchas

olead
lock dsleelf

Uses public private labeling þf messages.


-

Messages may replace their labels at each site.


When a
message arrives at a site with
detected matching public
(by only the process with the
a
label, a
deadlock is
normally does resolution by self - destruct.largest public label in the cycle) which
Example:
1. P6 initially asks P8 for its
public label and changes its own 2 to 3.
2. P3 asks P4 and
changes its public label 1 to 3.
3. P9 asks P1 and finds its
P1 => P2 => P3 => P4 =>
own
public label 3 and thus detects the deadlock
P5 => P6 => P8 => P9 =>
P1.

P10P2 P3 Public 1-3


Private 1

S1 hl

P8 ab QP4
P100
PS
$3 P7
$2
Public 3
Private 3 1 Public 2 => 3
Private 2
Fig. 3.11.2
TECHNICAL PUBLICATIONS-
An up thrust for
knowledge
3- 23 Distributed Mutex and Deadlock
ADrocess determines if it is deadlocked by initiating áojRaA
DistributedSystems

diffusion computation.
3.11.3
Diffusion Computation based Algorithm

Two types of messages used for this are the quefy (i, j, k) and the reply (l, j, k)

messages. exotto
A
A blocked process initiates deadlock detection by sending query messages to all
theprocesses from whom it is waiting to receive a message (dependent set).
°Fexe

9pcp processes will discard query and reply messages.


Proce

Active
Upon receiving the first query message inthated by P, the blocked process P
propagates the query to all the processes in its dependent set and sets a local
variable num,(i) to the number of query messages sent.

If the query message is not the first one received by Py initiated by P, it replies toit
it if it has been continuously been blocked since the first query. Otherwise,
discards the query.

A
The process Py will finally send a reply message to Pi when it has received a reply
B
for every query message that it sent. For every replý, Pg will decrement num^(i)
and when num,1)=0, it sends a reply to P
. An initiator-detects a deadlock when it receives reply messages to all the query

messages it had sent out.


ien
3.11.4 Global State Detection
cuted ol:ad och

.Based on two facts of distributed systems


consistent snapshot|of a/distributed system can be
obtained without freezing_,
the underlying computation.
state at any moment in
b. A consistent snapshot may not represent the system
time, but if a stable property holds in the system before the _napshot.collection
Sed.
is initiated, this property will still hold in the snapshot. nhicte
Flocdas Rau Echs
The P-out-of-Q request model

An initiator computation snapshots


the system by sending FLOOD messages along
all its outbound edges in an outward sweep,

FLOOD message either returns an ECHO message (if it


A computation receiving a

or propagates the FLOOD message


to it dependencies.
dependencies itself),
has no

An echo message is analogous to dropping a request edge/in a Resourc


Allocation Graph (RAG). initiator is
arrive in response to FLOODs the region
of the WFG the
AS
ECHOs
involved with becomes reduced. Rea
ECo n
RA G
knowledge &enet Reuun
TECHNICAL PUBLICATIONS"- An up thrust for
Flood ms
Distnbuted Systems 3- 24 Distributed Mutex and Deadlock
If a
dependencydoes not return an ECHO by termination, such a node represents
part (or all) of a deadlock with the initiator.
Termination is achieved by summing weighted ECHO and SHORT
messages
(returning initial FLOOD weights).

|Two Marks Questions with Answers

Q.1 What is mutual exclusion ?


Ans. Mutual exclusion in a distributed
to execute the critical section
system states that only one process is allowéd
(CS) at any
variables or a local kernel cannot be used togiven
time. In a distributed
system, shared
implement mutual exclusion.
Q2 Which are the three basic
exclusion? approaches for implementing distributed mutual
Ans. There are
three basic approaches for
implementing distributed mutual exclusion:
1. Token based
approach
2.
Non-token based
approach
3. Quorum based
approach
Q.3 What are the
requirements of mutual exclusion
Ans.:
Requirements of mutual exclusion algorithms
a. Freedom from deadlocks b.
are algorithms
C. Strict fairness
Freedom from starvation
d. Fault tolerance
Q4 What are the
performance metric of mutual exclusion
Ans. Performances metric are algorithm ?
time and
system throughput. message complexity, synchronization delay,
Q.5 What is response
response time?
Ans.: The time
interval a request waits
messages have been sent out. for its CS
execution to be over
after its
Q6 Which are the request
criteria for
exclusion ? evaluating performance of
Ans.
Criteria for algorithms for mutual
evaluating
a.
Bandwidth consumedperformance of algorithms for mutual exclusion
each entry and which is are
exit proportional to the number
b. Client delay incurred by
operation. of
messages sent in
a
C.
Throughput of the system. process at each entry and exit operation.

You might also like