You are on page 1of 2

Explain Mitchell-Merritt Algorithm for single resource nodel.

This deadlock detection algorithm assumes a single resource model.


Each Node has two labels: Public & Private.
Private Label Is unique to node but may chang.
Apublic label, which can be read by other processes and which may not be unique.
Initally both private and public label values are same.
Guarantees that only one process will detect the deadlock
Probes are sent in the opposite direction to the edges of the WFG.
When a probe inittated by a process comes back to it, the process declares deadlock.

The algorithm is defined by the four state transitions as shown in Fig.


The transitions defined by the algorithm are
1. Block
2. Activate
3. Transmit
4. Detect
Block: creates an edge in the WFG.
Activate:Earlier there is an edge in the before state, but there will be no edge in the after state.
Transmit: If the public label of waiting process is smaller than the public label of the process upon
whom it is walting, then waiting process will change its putblic label equal to the publc label of the
process upon whom it is waiting Waiting process's private label renains unchangged.
Detect:When a process sees its own public label comes back to itself and declares deadlock

ock

Activate

Tanamit

Rigure 102 The four possile


stane transitions [2

Example
Step 1:

P1 P3

yotm pubie ane


ada ar aal

PS P4

11
Step 2:
Transmit

P1 73 P3 Here P1 reads public


7.3 label of P3
41
Pl's public label (4, 1)

P3's public label =(7.3)


So P1 will change is
public label to (7,3)
5.5
P5 44
P4 But No change for
55 private label of P1

Step 3:

Transmit
7.3
P1 P3
P1's public label (7,3)
PSS public label m(6,5)
Transmit So P5 will change is publie
label to (7,3)
But No change for private
ofP#
P5 44
P4

Step 4:

Transmit

P1 7.3 7.3 P3
7.3 P5's public label =7,3
P3's public label =7,3
Transmit So P3 Detects Deadlock

Transmit
7.3 4,4
P5 44
P4
65

You might also like