CS Compass Logo

CS Compass

Your CS Navigator

Deadlock

Learn how deadlocks occur in Operating Systems and how they can be prevented.

What is Deadlock?

A Deadlock is a situation in which two or more processes are waitingfor resources held by each other, and none of them can proceed.

Necessary Conditions of Deadlock

Example of Deadlock

Process P1 holds Resource A and waits for Resource B. Process P2 holds Resource B and waits for Resource A. Both processes wait forever.

Methods to Handle Deadlock

Prevention Techniques