Solutions to deadlock
There are several ways to address the problem of deadlock in an operating system.
Just ignore it and hope it doesn't happen
Detection and recovery - if it happens, take action
Dynamic avoidance by careful resource allocation. Check to see if a resource can be granted, and if granting it will cause deadlock, don't grant it.
Prevention - change the rules
Ignore deadlock
The text refers to this as the Ostrich Algorithm. Just hope that deadlock doesn't happen. In general, this is a reasonable strategy. Deadlock is unlikely to occur very often; a system can run for years without deadlock occurring. If the operating system has a deadlock prevention or detection system in place, this will have a negative impact on performance (slow the system down) because whenever a process or thread requests a resource, the system will have to check whether granting this request could cause a potential deadlock situation.
http://www.cs.rpi.edu/academics/courses/fall04/os/c10/
Ostrich algorithm
n computer science, the ostrich algorithm is a strategy of ignoring potential problems on the basis that they may be exceedingly rare - "to stick your head in the sand and pretend that there is no problem". This assumes that it is more cost-effective to allow the problem to occur than to attempt its prevention.
This approach may be used in dealing with deadlocks in concurrent programming if deadlocks are believed to be very rare, and if the cost of detection or prevention is high
http://en.wikipedia.org/wiki/Ostrich_algorithm
No comments:
Post a Comment