A deadlock occurs when two or more tasks permanently block each other by each task having a lock on a resource that the other tasks are trying to lock.
Deadlocks tend to occur when things operate on multiple datasets in different order -- A needs something that B is has a lock on and B has something that A has ...