Chapter 5: Memory Management: The Ostrich Algorithm
Chapter 5: Memory Management: The Ostrich Algorithm
A second technique is detection and recovery. When this technique is used, the system does not do anything except monitor
the requests and releases of resources. Every time a resource is requested or released, the resource graph is updated, and a
check is made to see if any cycles exist. If a cycle exists, one of the processes in the cycle is killed. If this does not break the
deadlock, another process is killed, and so on until the cycle is broken.
The Ostrich Algorithm
The simplest approach is the ostrich algorithm: stick your head in the sand and pretend there is no problem at all.[] Different
people react to this strategy in very different ways. Mathematicians find it completely unacceptable and say that deadlocks
must be prevented at all costs.
Most operating systems, including UNIX, MINIX 3, and Windows, just ignore the problem on the assumption that most
users would prefer an occasional deadlock to a rule restricting all users to one process, one open file, and one of everything.
If deadlocks could be eliminated for free, there would not be much discussion. The problem is that the price is high, mostly
in terms of putting inconvenient restrictions on processes. Thus we are faced with an unpleasant trade-off between
convenience and correctness, and a great deal of discussion about which is more important, and to whom. Under these
conditions, general solutions are hard to find.
Page:59 Compiled by: Daya Ram Budhathoki
1
Contiguous