Ostrich algorithm

Ostrich algorithm

In 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.

Trade-offs

  • Convenience
  • Correctness

It is one of the methods of dealing with deadlocks. Other methods are: avoidance (banker's algorithm), prevention, detection and recovery.

Some algorithms with poor worst-case performance are commonly used because they only exhibit poor performance on artificial cases that do not occur in practice; typical examples are the simplex algorithm and the type-checking algorithm for Standard ML. Issues like integer overflow in programming languages with fixed-width integers are also frequently ignored because they occur only in exceptional cases that don't arise for practical inputs.

Hybrid Approach

Hybrid approach to using Ostrich algorithm is determining that the exceedingly rare case does not happen, and then switching from another costly algorithm to this one. The trade-off here is that if circumstances change or are unaccounted for, the rare problem may re-occur.

An example can be found in the Non Hard-Locking ReadWriteLocker[1] site, where you have the option to determine where deadlocks might occur, and then turn off deadlock detection once you determine it doesn't need to be used.

References



Wikimedia Foundation. 2010.

Игры ⚽ Поможем решить контрольную работу

Look at other dictionaries:

  • Ostrich (disambiguation) — The Ostrich is a large flightless bird. Ostrich may also refer to: Contents 1 Animals 1.1 Birds 1.1.1 Ostrich derivatives …   Wikipedia

  • Deadlock — This article is about the computer science concept. For other uses, see Deadlock (disambiguation). A deadlock is a situation where in two or more competing actions are each waiting for the other to finish, and thus neither ever does. It is often… …   Wikipedia

  • Peter Gutmann (computer scientist) — Peter Gutmann is a computer scientist in the Department of Computer Science at the University of Auckland, Auckland, New Zealand. He has a Ph.D. in computer science from the University of Auckland. His Ph.D. thesis and a book based on the thesis… …   Wikipedia

  • Centroidal Voronoi tessellation — In geometry, a centroidal Voronoi tessellation (CVT) is a special type of Voronoi tessellation or Voronoi diagrams. A Voronoi tessellation is called centroidal when the generating point of each Voronoi cell is also its mean (center of mass). It… …   Wikipedia

Share the article and excerpts

Direct link
Do a right-click on the link above
and select “Copy Link”