All lessons in Software Engineering: Programs, Systems, and Maintainable Software
Deadlocks, Scheduling, and Bounded Work
Construct a wait-for graph and prevent deadlock without confusing safety and fairness.
35 minutes · Members lesson · preview
What you will learn
- Detect a circular wait using a resource-ownership trace.
- Choose a consistent lock order and explain its limits.
- Calculate waiting and turnaround times for a small schedule.
One worker holds the member lock and waits for the copy lock. Another holds the copy lock and waits for the member lock. Neither can finish and release what the other needs. Both pieces of code may be locally reasonable, but their combined resource order creates a deadlock.
Concurrency design must explain progress as well as mutual exclusion. A program can preserve every data invariant while making no useful progress at all.