Explain data structures used in bankers algorithm
1 Answer

The banker’s algorithm is a method used in deadlock avoidance technique in multiple instances of a resource type.

The various data structures used in it are:

  • Total_resource[ i ]: A 1-D matrix of size m .It stores the total number of resources in a system.
  • Max[i , j ]: A 2-D matrix where each process stores the maximum demand of resources (Rj) of process Pi.
  • Allocation [i , j]: A 2-D matrix which stores the current allocation status of all resource types to various process in the system.
  • Need [i , j]: A 2-D matrix which tells the current remaining resource need of each process. It is the maximum demand of a process and the current allocation status. Need[ i,j]= Max[i , j ] - Allocation [i , j]
  • Avail[i]: A 1-D matrix which stores the current available instances of each resource type.
Please log in to add an answer.