| Theory | Deadlock is a situation in which two computer programs sharing the 
same resource are effectively preventing each other from accessing 
the resource, resulting in both programs ceasing to function.
When a new process enters a system it declares the maximum number 
of instances of each resource type it needed which should not exceed the 
total number of resources in the system.
The system always determines whether the allocation of each resources will leave 
the system in safe state for any user request a set of resources . 
If the resources are not allocated to the process at the moment the 
process has to wait until some other process release the resources used by it. |