deadlock

Deadlock is a situation where a set of processes are blocked because each process is holding a resource and waiting for another resource acquired by some other process. 
Consider an example when two trains are coming toward each other on the same track and there is only one track, none of the trains can move once they are in front of each other. A similar situation occurs in operating systems when there are two or more processes that hold some resources and wait for resources held by other(s). 
Deadlock can arise if the following four conditions hold simultaneously (Necessary Conditions) 
* Mutual Exclusion: Two or more resources are non-shareable (Only one process can use at a time) 
* Hold and Wait: A process is holding at least one resource and waiting for resources. 
* No Preemption: A resource cannot be taken from a process unless the process releases the resource. 
* Circular Wait: A set of processes are waiting for each other in circular form.