A number of processes could be in a deadlock state if none of them can execute due to non-availability of sufficient resources. Let Pi,0≤i≤4 represent five processes and let there be four resources types rj,0≤j≤3. Suppose the following data structures have been used.
Available: A vector of length 4 such that if Available [i]=k, there are k instances of resource type rj available in the system.
Allocation. A 5×4 matrix defining the number of each type currently allocated to each process. If Allocation [i,j]=k then process pi is currently allocated k instances of resource type rj.
Max. A 5×4 matrix indicating the maximum resource need of each process. If Max[i,j]=k then process pi, may need a maximum of k instances of resource type rj in order to complete the task.
Assume that system allocated resources only when it does not lead into an unsafe state such that resource requirements in future never cause a deadlock state. Now consider the following snapshot of the system.