title: How to find deadlock reasons for a process on UNIX practically ?
body: <p>On unix, a process is stuck, you doubt that it may be deadlock, find the reasons for deadlocking and how to remove and avoid it ? </p>
  
  <p>I know the 4 conditions for deadlock:</p>
  
  <ol>
  <li><p>Mutual exclusion: A resource can be assigned to at most one process at a time (no sharing).</p></li>
  <li><p>Hold and wait: A processing holding a resource is permitted to request another.</p></li>
  <li><p>No preemption: A process must release its resources; they cannot be taken away.</p></li>
  <li><p>Circular wait: There must be a chain of processes such that each member of the chain is waiting for a resource held by the next member of the chain.</p></li>
  </ol>
  
  <p>But, they are theoretical,  how to determine a deadlock on unix practically ? 
  Only by seeing that a process does not make progress ? 
  How to find which part of the code cause the deadlock and the reasons ? 
  If you are allowed to use tools, what can be used ? </p>
  
  <p>thanks</p>