title: How can I find whether a process is in deadlock or is waiting for I/O
body: <p>Asked by an Interviewer:
  How can we find if an application has become non responsive due to a deadlock or due to wait on some IO?<br>
  Can anybody comment any general way of doing this, or if various provides some specific ways of doing this?<br>
  This is an OS related thing I believe so I am not tagging any language here.  </p>
  
  <p>EDIT: I would like to know about the techniques and the APIs as well to do this. So that i can run a monitoring program if i wish.</p>