What is deadlock? How can I eliminate it?

Stephen Leonard

A simple deadlock situation is one in which a two threads are waiting. Each thread waiting for a resource which is held by the other waiting thread. [In Java, this resource is usually the object lock obtained by the synchronized keyword.]

This deadlock situation can range from the above two thread situation to any number of threads waiting in a circular fashion.

Many solutions to this well known problem have been defined over the years including the large range of solutions to "The Dining Philosophers" problem.

Hope this can point you in the right direction.

Stephen ...