Problem Statement
What are the four necessary conditions for a deadlock to occur? Explain each one.
Explanation
There are four classic conditions that must simultaneously hold for a deadlock: mutual exclusion (resources cannot be shared and only one process may use a resource at a time), hold and wait (a process holds at least one resource and is waiting to acquire additional resources held by others), no preemption (resources cannot be forcibly taken from a process; they must be released voluntarily), and circular wait (a closed chain of processes exists where each process holds a resource needed by another process in the chain). If you break any one of these, you can prevent deadlock.
