Deadlocks occur when a set of processes are blocked because each process is holding a resource and waiting for another resource held by another process in the set. For example, two processes P1 and P2 each hold one of two disk drives and each needs the other disk drive. Deadlock can arise when four conditions hold simultaneously: mutual exclusion, hold and wait, no preemption, and circular wait. A resource-allocation graph with vertices for processes and resources and edges for requests and assignments can model resource usage and identify if a deadlock cycle exists. The presence of a cycle indicates the potential for deadlock.