Distributed System CSC-503 Distributed Deadlock Handling: Indian Institute of Technology Roorkee
Distributed System CSC-503 Distributed Deadlock Handling: Indian Institute of Technology Roorkee
Distributed System
CSC-503
Distributed Deadlock Handling
(C) When TCP uses SO_LINGER option and l_onoff and l_linger
both are nonzero then TCP always ensures that if any data is still
remaining in TCP send buffer, then all data is sent and
acknowledged by the peer process. FALSE
1
9/18/2024
Consider two clocks that drift 1 second in every 106 seconds with
respect to each other. What is the resynchronization interval
sufficient to limit their skew to 20 milliseconds?
1 2 5
3 4 5
1 6
2
9/18/2024
100 200
001 232
3
9/18/2024
1 2 5
3 4 5
1 6
4
9/18/2024
3, 1
1,2
6, 3
S1 - 0 0 1
S2 1 - 0 1
S3 1 1 - 1
S4 0 0 0 -
3, 1
1,2
6, 3
5
9/18/2024
S1 - 0 0 1
S2 0 - 0 1
S3 1 1 - 1
S4 0 0 0 -
3, 1
1,2
6, 3
0100
1101
6
9/18/2024
1101
7
9/18/2024
Deadlock
• Exclusive access
• Wait while hold
• No preemption
• Circular wait
8
9/18/2024
P1 P2 P3
Receive m3 p3 receive m1 p1 receive m2 p2
send m1 p2 send m2 p3 send m3 p1
9
9/18/2024
A Graph-Theoretic Model
10
9/18/2024
P1 P2
P4 P3
11
9/18/2024
• Deadlock Detection:
• Deadlock Detection:
– Maintenance of WFG
– Searching WFG for cycle / knot
• Correctness Criteria:
(i) Progress (No undetected deadlocks)
All deadlocks must be detected in finite time
(ii) Safety (No false deadlocks)
12
9/18/2024
Models of Deadlocks
Request Models: Type of requests
• Only one resource at a time
• Many resources at a time
• Few of many resources at any time
Models of Deadlocks
The Single Unit Request Model
• A process can have at most one outstanding request
for only one unit of a resource.
• Maximum out-degree of a node in a WFG for the
single resource model can be 1
• The presence of a cycle in the WFG shall indicate that
there is a deadlock (provided that there is only one
unit of every resource in the system)
13
9/18/2024
The OR Model
• In the OR model, a process can make a request for
numerous resources simultaneously
• Process remains blocked until it is granted any one of
the requested resources.
• Presence of a cycle in the WFG does not imply a
deadlock
• In the OR model, the presence of a knot indicates a
deadlock
• A process not in the knot may also be deadlocked.
14
9/18/2024
15