Chapter 05 Dead Lock
Chapter 05 Dead Lock
Deadlocks
Deadlock
A deadlock is a situation in which two or more competing
actions are each waiting for the other to finish, and thus neither
ever does.
Deadlock occurs when each transaction T in a set of two or
more transactions is waiting for some item that is locked by
some other transaction T′ in the set. Hence, each transaction in
the set is in a waiting queue,
Suppose we have the following scenario:
• T1 asks for an exclusive lock on A
• T2 asks for an exclusive lock on B
• T1 asks for a shared lock on B
• T2 asks for a shared lock on A
Both T1 and T2 are waiting! We have a DEADLOCK.
3 Deadlock - Examples
4
Deadlock Management
5