Concurrency: deadlock and synchronisation
Running tasks at once safely; deadlock occurs when tasks wait forever for each other's resources.
Edited by Alex C, EduAlx · Sources cited below
Explanation
Dijkstra introduced semaphores (1965) and the dining philosophers problem. Coffman's four conditions for deadlock are mutual exclusion, hold and wait, no pre-emption and circular wait. Locks, monitors (Hoare) and message passing prevent race conditions. Lamport's work on distributed systems received the 2013 Turing Award.
Example
How it works, step by step
- Identify shared data
- Protect it with a lock or semaphore
- Order lock acquisition to avoid cycles
- Test under load for races
Open the interactive page with diagrams →
People behind it
- Edsger Dijkstra (1930–2002), Computer science, Netherlands: Invented the shortest-path algorithm, semaphores and structured programming. Turing Award 1972.
- Tony Hoare (b. 1934), Computer science, UK: Invented quicksort, Hoare logic and CSP. Turing Award 1980.
- Leslie Lamport (b. 1941), Distributed systems, USA: Developed logical clocks, Paxos consensus and LaTeX. Turing Award 2013.
References
- E. W. Dijkstra, Commun. ACM 1965, 8, 569.
- E. G. Coffman, M. Elphick, A. Shoshani, ACM Comput. Surv. 1971, 3, 67–78.
- L. Lamport, Commun. ACM 1978, 21, 558–565.
Textbooks
- Operating System Concepts, Abraham Silberschatz, Peter B. Galvin, Greg Gagne (Wiley, 10th ed. 2018). The 'dinosaur book'.
- Modern Operating Systems, Andrew S. Tanenbaum, Herbert Bos (Pearson, 5th ed. 2022). Classic OS text.
Related topics
File systems and storageOperating systems: processes, scheduling and memoryVirtualisation and containersCloud computingRelational databases and SQLComputer networks and the TCP/IP modelVon Neumann architectureWorld Wide Web, HTTP and HTMLBoolean logic and digital circuitsInformation theory and entropy