Thursday, August 20, 2009

DEADLOCK PREVENTION

  • deadlock requires the following conditions:

-mutual exclusion:

-resources not sharable

-hold and wait:

-process must be holding one resource while requesting another

-circular wait:

-at least 2 processes must be blocked on each other

  • eliminate mutual exclusion:

-not possible in most cases
-spooling makes I/O devices sharable

  • eliminate hold-and-wait

-request all resources at once
-release all resources before a new request
-release all resources if current request blocks

  • eliminate circular wait

-order all resources: SEQ(Ri) ? SEQ(Rj)
-process must request in ascending order

No comments: