Monday 19 March 2012

Safety Algorithm


  • Let Work and Finish be vectors of length m and n, respectively.  Initialize:

Work = Available
Finish [i] = false for i - 1,3, …, n.
  • Find and i such that both:

  1.  Finish [i] = false
  2.  Needi £ Work

      If no such i exists, go to step 4.
  • Work = Work + Allocationi

                      Finish[i] = true
             go to step 2.
  • If Finish [i] == true for all i, then the system is in a safe state.

No comments:

Post a Comment