A few days ago, my friend and I were discussing denial. What is denial? Denial, if you don’t know, is completely avoiding a situation or ignoring the inevitable and believing that it is not there. Now, what do you think about denial? Obviously, you will think that it is not a trait worth cultivating. But what if I told you that in many situations utter and unreasonable denial is the best strategy by far, constantly ignoring the inevitable like it will never happen. Surprised? Well you should, as from the very beginning we are told to tackle problems upfront and never to avoid it and it is the right decision in most cases, but unfortunately not all.
Can you think of one case where denial is the best strategy? In fact, the best one is essential for our function and embedded so well in our psyche that it is hard to identify it. Any guess? Well, it is the denial of death. Without denial, every man (and woman) on the earth will be thinking about death, which is inevitable, and what to do about it. The reason we don’t do that and are able to engage in perfunctory activities is that we are constantly ignoring that fact. We know we are going to die, but most of the time in our subconscious we like to believe that we will leave forever. This denial lets us function, discover, invent and succeed.
Many of you may find the example of death too extreme, as death is inevitable and it does not seem that we can solve it ever (don’t confuse the denial of death here with the desire of elongated life, with fear of death it doesn’t matter whether you die in a year, hundred years, thousand years or at the doom of mankind). But what about the problems which are very much evitable and can be avoided with careful planning? Is it ever better to avoid them? Matter of fact, it is in some cases, and that brings us to Ostrich Algorithm.
Ostrich Algorithm is more of an approach than an actual algorithm as it suggests doing nothing. It is the most popular approach for tackling deadlock* in many computer systems. The name is derived from the bird ‘Ostrich’ which is believed (however, wrongly) to bury its head in sand when a threat approaches. (Actually, the poor bird is checking its eggs, which it lays under the ground; when it buries its head as you might have seen in many pictures). In Ostrich approach of deadlock prevention, the computer assumes that deadlock will never occur, although it may very well occur and can crash the system. However, in most of the computer system, the chance of such deadlock is negligible, while constantly checking for deadlocks and preventing them can slow the system down. People don’t care if their computer crashes, once a year and they had to press the reset button. For most of us, system crashes multiple times in a year and mostly not due to deadlock. However, the same cannot be told for ‘Nuclear Reactor Controller’, their reliability take place over performance and ingenious deadlock prevention techniques must be used.
After all his discussion, if you still don’t want to believe that in many cases denial is good, then you are in the state of denial; but if that encourages you to tackle any problem upfront and makes you enthusiastic, remain in that denial, for denial is good.
*In computer science deadlock refers to the situation where two processes are waiting for resources held by each other. E.g. process A is holding resource x and waiting for resource y, while process B is holding y and waiting for x. Both the processes are stuck in a perpetual waiting. This also applies to more than two processes.