In
computer science
Computer science is the study of computation, information, and automation. Computer science spans Theoretical computer science, theoretical disciplines (such as algorithms, theory of computation, and information theory) to Applied science, ...
, the ostrich algorithm is a strategy of ignoring potential problems on the basis that they may be exceedingly rare. It is named after the
ostrich effect
The ostrich effect, also known as the ostrich problem, was originally coined by Dan Galai and Orly Sade. The name comes from the common (but false) legend that ostriches bury their heads in the sand to avoid danger. This effect is a cognitive bias ...
which is defined as "to stick one's head in the sand and pretend there is no problem". It is used when it appears the situation may be more cost-effectively managed by allowing the problem to continue to occur rather than to attempt its prevention.
Use with deadlocks
This approach may be used in dealing with
deadlock
Deadlock commonly refers to:
* Deadlock (computer science), a situation where two processes are each waiting for the other to finish
* Deadlock (locksmithing) or deadbolt, a physical door locking mechanism
* Political deadlock or gridlock, a si ...
s in
concurrent programming
Concurrent means happening at the same time. Concurrency, concurrent, or concurrence may refer to:
Law
* Concurrence, in jurisprudence, the need to prove both ''actus reus'' and ''mens rea''
* Concurring opinion (also called a "concurrence"), a ...
if they are believed to be very rare and the cost of detection or prevention is high. A set of processes is deadlocked if each process in the set is waiting for an event that only another process in the set can cause.
The ostrich algorithm pretends there is no problem and is reasonable to use if deadlocks occur very rarely and the cost of their prevention would be high. The
UNIX
Unix (, ; trademarked as UNIX) is a family of multitasking, multi-user computer operating systems that derive from the original AT&T Unix, whose development started in 1969 at the Bell Labs research center by Ken Thompson, Dennis Ritchie, a ...
and
Windows
Windows is a Product lining, product line of Proprietary software, proprietary graphical user interface, graphical operating systems developed and marketed by Microsoft. It is grouped into families and subfamilies that cater to particular sec ...
operating systems take this approach.
Although using the ostrich algorithm is one of the methods of dealing with
deadlock
Deadlock commonly refers to:
* Deadlock (computer science), a situation where two processes are each waiting for the other to finish
* Deadlock (locksmithing) or deadbolt, a physical door locking mechanism
* Political deadlock or gridlock, a si ...
s, other effective methods exist such as dynamic avoidance,
banker's algorithm
Banker's algorithm is a resource allocation and deadlock avoidance algorithm developed by Edsger Dijkstra that tests for safety by simulating the allocation of predetermined maximum possible amounts of all resources, and then makes an "s-state" ch ...
, detection and recovery, and prevention.
See also
*
Crash-only software
A crash-only software is a computer program that handle failures by simply restarting, without attempting any sophisticated recovery. Correctly written components of crash-only software can microreboot to a known-good state without the help of a ...
*
End-to-end principle
The end-to-end principle is a design principle in computer networking that requires application-specific features (such as reliability and security) to be implemented in the communicating end nodes of the network, instead of in the network itse ...
References
External links
Ostrich algorithmNon-Hard Locking Read-Write Locker{{Webarchive, url=https://web.archive.org/web/20111218194302/http://nohardlockrwlocker.codeplex.com/ , date=2011-12-18
Deadlock Basics + Modelling + Ostrich Algorithm
Concurrent algorithms