What is it?

In multi-threading applications or Distributed Computing systems, a deadlock occurs when a waiting thread is locking a resource that the other one needs it before it can finish.

To avoid having deadlocks one can:

  • Avoid applying Locks at all, if possible;
  • Avoid having multiple Locks;
  • Always take Locks explicitly in the same order.