Unit 5: Deadlock
Deadlock is a paralyzing process state resulting from improper CPU scheduling, process management, and synchronization management. During this time, processes are blocked as they compete for system resources or only communicate with each other. Although it cannot be guaranteed that deadlock may be avoided 100% of the time, it is important to know how to avoid the deadlocked state and how to recover from it once it has been achieved. We will build upon the previous two units of CPU Scheduling and Processes and Threads when discussing Deadlock. First, we will discuss what deadlock is by establishing a working definition and the conditions in which it presents itself. Then, we will talk about how to prevent and avoid deadlock. Finally, we will learn about deadlock detection, as well as methods for recovering from a deadlocked state.
Completing this unit should take you approximately 9 hours.
Upon successful completion of this unit, you will be able to:
- explain what deadlock is in relation to operating systems;
- discuss deadlock prevention, avoidance, and the differences between each; and
- describe deadlock detection and recovery.
5.1: Definition
Watch the first lecture starting at 52:40, and watch the second lecture until 43:15.
Read these lecture notes.
5.2: Deadlock Prevention and Avoidance
Read slides 10 through 16.
Read through the review of the Banker's Algorithm if you need to review the way that the algorithm works. Complete both exercises and check your answers against the answer key.
5.3: Deadlock Detection and Recovery
Read this document.
Complete this lab. All instructions are included for downloading and running the simulator. Compare the results of your experiments to the answer key.