Concept:
• Deadlock is a state in which a set of processes are blocked because each process is holding a resource and waiting for another resource held by another process.
• Prevention: Ensuring that at least one of the four necessary conditions (Mutual Exclusion, Hold and Wait, No Preemption, Circular Wait) can never hold.
• Avoidance: Dynamically deciding whether a resource allocation is safe using algorithms like Banker's.
• Detection and Recovery: Periodically checking the system state for cycles and taking corrective action.
Step 1: Match A with III (Deadlock Prevention)
Deadlock prevention works by denying one of the four necessary conditions. A classic method is preventing "Circular Wait" by imposing a linear ordering of resource types.
So, A matches with III.
Step 2: Match C with I (Deadlock Avoidance)
Deadlock avoidance requires the OS to know in advance the maximum resources a process will ever request. The "Banker's Algorithm" uses this to ensure the system stays in a "safe state."
So, C matches with I.
Step 3: Match D with II (Recovery from Deadlock)
Once a deadlock is detected, the system must recover. One way is "Rollback," which involves returning a process to a previous "safe" checkpoint so it can release its resources.
So, D matches with II.
Step 4: Match B with IV (Deadlock Detection)
Detection algorithms maintain resource graphs and check for cycles. Because these checks are computationally expensive and run frequently, they impose "High Overheads" on the system.
So, B matches with IV.