Level 5 of 12 · about 2 weeks
Deadlocks
How threads and processes end up waiting for each other for ever, how to see it, how to prevent, avoid, detect and recover from it, and how to debug a real one.
Modules
Core: everyone needs it. Common: most jobs use it. Specialist: optional depth, safe to skip on a first read.
1
What a deadlock is and the four conditions
How two threads can wait for each other forever, and the four conditions that must all hold for it to happen
Core 7 parts · about 4 hours
2
Resource graphs and finding the cycle
How to draw who holds what and who waits for whom, and how to find a deadlock by looking for a cycle
Core 7 parts · about 4 hours
3
Prevention, breaking one of the four conditions
How to write programs and systems in which a deadlock cannot form, by removing one of the four conditions
Core 8 parts · about 5 hours
4
Avoidance, safe states and the banker's algorithm
How a system can refuse a request that is allowed by the rules but could lead to a deadlock later
Common 7 parts · about 5 hours
5
Detection and recovery
How a system lets deadlocks happen, finds them, and breaks them by stopping, rolling back or preempting a victim
Common 8 parts · about 5 hours
6
Livelock, starvation and other ways to be stuck
Five ways a program stops making progress without a classic lock cycle, each reproduced and measured
Common 8 parts · about 5 hours
7
Case study, finding and fixing a deadlock
A frozen transfer service, traced from the first symptom to a tested fix, with the tools used at each step
Core 8 parts · about 5 hours