Deadlocks & Deadheads

In contrast to deadheads, deadlocks are conditions where two or more threads are waiting for an event that can only be generated by these same threads.  Or said differently, it is a set of blocked processes each holding a resource and waiting to acquire a resource held by another process in the set.

It is like if someone else has the bread and no peanut butter, when you have the peanut butter but no bread.  Or, you have the bowl of froot loops but no milk and someone else has the milk but no froot loops.

Another deadlock scenario might be building a giant water slide outside your house.  To get your building permit, you first need to get a loan from the bank.  To get the loan from the bank, you need the building permit.

To resolve this kind of situation, either the bank or the city has to realize that the process is flawed to make an exception.  Perhaps you could get a letter of intent from one of the parties which would prove to the other side the process is started, but pending.

In computer science, we have a variety of options for solving various deadlock scenarios, although the general reasoning is still applicable to real life.

While sometimes deadlock prevention is easier than solving it, as the Grateful Dead song goes, “Watch each card you play and play it slow.”  Sometimes the problems worth solving in life take a little time.