4 Conditions for Deadlock
Deadlock can exist if and only if 4 conditions hold simultaneously:
1. mutual exclusion: at least one process must be held in a non-sharable mode.
2. hold and wait: there must be a process holding one resource and waiting for another.
3. No preemption: resources cannot be preempted.
4. circular wait: there must exist a set of processes
[p1, p2, …, pn] such that p1 is waiting for p2, p2 for p3, and so on….