(Usage hints for this presentation)
IT Systems, Summer Term 2025
Dr. Jens Lechtenbörger (License Information)
Did you play level “Deadlock” at https://deadlockempire.github.io/?
Permanent blocking of thread set
“Gridlock” by Interiot~commonswiki and Jeanacoa under CC BY-SA 2.5 Generic; from Wikimedia Commons
myAccount to yourAccount by thread 1; transfer in
other direction by thread 2myAccount, while thread 2 locks yourAccount
Deadlock if and only if (1) – (4) hold (Coffman, Elphick, and Shoshani 1971):
Nodes

“Figure 4.22 of (Hailperin 2019)” by Max Hailperin under CC BY-SA 3.0; converted from GitHub
(Refresh HTML presentation for other drawings)
Practical options
Prevent condition (2), “hold and wait”: Request all necessary resources at once
Prevent condition (4), “circular wait”: Number resources, request resources according to linear resource ordering
myAccount has number 42, yourAccount is 4711
myAccount first (as 42 < 4711)
yourAccountDynamic decision whether allocation may lead to deadlock
Classical technique
Idea
Prerequisite to build graph

Dining Philosophers
“Figure 4.20 of (Hailperin 2019)” by Max Hailperin under CC BY-SA 3.0; converted from GitHub
Starvation of P0

“Figure 4.20 of (Hailperin 2019)” by Max Hailperin under CC BY-SA 3.0; converted from GitHub
Robotic spacecraft named Pathfinder

“Sojourner Rover” by NASA under Public domain; from Wikimedia Commons
synchronized in Java
wait() and notify()Source files are available on GitLab (check out embedded submodules) under free licenses. Icons of custom controls are by @fontawesome, released under CC BY 4.0.
Except where otherwise noted, the work “MX Challenges”, © 2017-2025 Jens Lechtenbörger, is published under the Creative Commons license CC BY-SA 4.0.