Thursday, August 20, 2009

DEADLOCK PREVENTION

Attacking Mutual condition
  • never grant exclusive access. but this may not be possible for several resources.
Attacking pre-emption
  • not something you want to do.
Attacking hold and wait condition
  • make a process hold at the most 1 resource at a time.
    make all the requests at the beginning. All or nothing policy. If you feel, retry. eg. 2-phase locking
Attacking circular wait
  • Order all the resources. Make sure that the requests are issued in the correct order so that there are no cycles present in the resource graph. Resources numbered 1 ... n. Resources can be requested only in increasing order. ie. you cannot request a resource whose no is less than any you may be holding.

No comments:

Post a Comment