A deadlock situation on a resource can arise if and only if all of the following conditions hold simultaneously in a system:

  1. mutual exclusion: At least one resource must be held in a non-shareable mode. Otherwise, the processes would not be prevented from using the resource when necessary. Only one process can use the resource at any given instant of time.
  2. hold and wait or resource holding: a process is currently holding at least one resource and requesting additional resources which are being held by other processes.
  3. no preemption: a resource can be released only voluntarily by the process holding it.
  4. circular wait: each process must be waiting for a resource which is being held by another process, which in turn is waiting for the first process to release the resource. In general, there is a set of waiting processes, P = {P1, P2, …, PN}, such that P1 is waiting for a resource held by P2, P2 is waiting for a resource held by P3 and so on until PN is waiting for a resource held by P1