Advanced Topics in Computer Systems |
Fall 2001
|
Joe Hellerstein & Anthony Joseph |
No! (starvation, unfair, etc.) So...
NL | IS | IX | S | SIX | X | |
NL | ||||||
IS | ||||||
IX | ||||||
S | ||||||
SIX | ||||||
X |
T2: X-lock Q
T1: X-lock Q // block waiting for T2
T2: S-lock P
T1: convert S-lock on P to X-lock // block
T2: convert S-lock on P to X-lock // block
In distributed systems, even this can be expensive, so often do periodic detection (more later)Typically, in centralized systems, run deadlock detection whenever blocking occurs. Arguably this is cheap: most recently blocked transaction T must be the one that caused the deadlock, so just DFS starting from T