Ostrich Algorithm for Deadlock Handling

0% found this document useful (0 votes)
444 views1 page
The ostrich algorithm is an approach to deadlocks that simply ignores the possibility that they could occur and reboots the system if one happens. It assumes deadlocks are rare so the cost o…

Uploaded by

ramana
  • Ostrich Algorithm

Ostrich Algorithm

The ostrich algorithm means that the deadlock is simply ignored and it is assumed that it will
never occur. This is done because in some systems the cost of handling the deadlock is much
higher than simply ignoring it as it occurs very rarely. So, it is simply assumed that the deadlock
will never occur and the system is rebooted if it occurs by any chance.

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.

If deadlock does occur, it may be necessary to bring the system down, or at least manually kill a
number of processes, but even that is not an extreme solution in most situations.

Common questions

Powered by AI

Implementing deadlock prevention mechanisms introduces complexity and can degrade system performance due to the overhead involved in monitoring resources and adjusting allocations to prevent deadlocks. However, it enhances reliability by minimizing the risk of system freeze or failure. In contrast, the Ostrich Algorithm offers higher system performance since it incurs no overhead from deadlock checks but at the cost of potentially facing disruptive deadlock events without notice. The choice between these depends on the frequency and impact of deadlocks relative to system performance requirements and reliability .

An operating system designer might justify implementing the Ostrich Algorithm by arguing that the chance of deadlock occurrence is minimal and the performance cost of implementing more complex deadlock prevention or detection strategies is not warranted. Furthermore, the consequences of a deadlock, such as system reboot or manual process termination, are seen as tolerable or trivial in comparison to the overhead costs. This justification would rely heavily on empirical data supporting the rarity of deadlocks in their specific system context .

The primary risk of relying on the Ostrich Algorithm is the potential occurrence of a deadlock, which could result in the system becoming unresponsive or requiring a reboot to resolve the situation. This method does not address the root cause of deadlocks, leaving systems vulnerable to potentially disruptive incidents. However, if deadlock occurrences are rare and the impact is manageable or non-critical, this approach may be acceptable .

Ignoring deadlocks via the Ostrich Algorithm might be most effective in systems where deadlocks occur very rarely and the consequences of such occurrences are negligible, such as non-critical applications where a system reboot incurs minimal cost or disruption. Conversely, it may be least effective in systems with critical uptime requirements, such as healthcare software or financial transaction systems, where the risks and consequences of downtime or data inconsistencies due to deadlocks are unacceptable .

The Ostrich Algorithm does not negatively impact system performance since it involves ignoring potential deadlocks and does not require constant monitoring or intervention, unlike other strategies. In contrast, deadlock prevention or detection mechanisms require the system to check for potential deadlocks whenever a resource is requested, which can slow down system performance due to the additional overhead .

It is considered reasonable to employ the Ostrich Algorithm when deadlocks are unlikely to occur frequently, and the cost of implementing and maintaining deadlock prevention or detection systems outweighs the potential inconvenience caused by a deadlock occurrence. This approach is suitable for systems where the occasional need to reboot the system or manually terminate processes is not considered a severe consequence .

The Ostrich Algorithm might not be suitable for operating systems where the consequences of a deadlock are severe, such as in real-time systems or critical applications, where downtime can lead to significant losses, safety hazards, or compromised service levels. Ignoring deadlocks in such contexts would be imprudent as it can lead to unrecoverable states without proper mitigation plans. Moreover, systems with high concurrency or those handling complex inter-process communications could be more prone to deadlocks, making a more robust deadlock management strategy necessary .

Dynamic avoidance mitigates deadlock risks by actively managing resources through careful allocation, ensuring that no allocation request leads to a deadlock. This approach continuously assesses if granting a resource request could lead to a deadlock and denies it if necessary. Unlike the Ostrich Algorithm, which ignores deadlocks, dynamic avoidance aims to prevent them by making informed decisions about resource allocation, thereby proactively minimizing risk .

The main strategies for dealing with deadlock in operating systems include ignoring the deadlock, detection and recovery, dynamic avoidance via careful resource allocation, and prevention by changing system rules. The Ostrich Algorithm fits into these strategies as a form of ignoring the deadlock. This approach assumes that the cost of addressing deadlock is higher than the cost incurred if such events were to occur, as they are rare. It involves ignoring the deadlock and rebooting the system if it occurs, relying on the assumption that deadlocks happen infrequently enough that ignoring them is a viable option .

The Ostrich Algorithm differs fundamentally from deadlock prevention and avoidance strategies in its approach to resource management. The Ostrich Algorithm involves simply ignoring the possibility of deadlock, assuming it will not occur often, and thus does not involve any active management of resources. On the other hand, deadlock prevention involves changing system rules to ensure that deadlocks cannot occur, and deadlock avoidance requires careful allocation of resources and constantly checks that each allocation does not lead to a deadlock. These latter strategies add complexity and overhead to the system as they require monitoring and active resource management to prevent or avoid deadlocks .

Ostrich Algorithm
The ostrich algorithm means that the deadlock is simply ignored and it is assumed that it will
never occur.

You might also like