Login Required
This note requires login to view the full content (95 lines total). Showing first 20 lines as preview. Please login to view the full content.
Login to unlockChapter 7: Deadlocks
Created: 2025-12-16
Updated: 2025-12-16
- Necessary Conditions for Deadlock
- Mutual Exclusion: exist a resource that only can be used by one process at a time
- Hold and Wait: a process holding some resources and is waiting for another resource
- No Preemption: a resource can only be released voluntarily
- Circular Wait: a set of processes are waiting for each other in a circular chain
- System Model
- resources types: (e.g. CPU, memory, IO devices)
- each resource type has instances (e.g. a computer has 2 CPUs)
- each process: request → use → release
- Resource-Allocation Graph
- a directed graph with processes and resources as nodes
- edge: requests
- edge: is allocated to
- if the graph contains no cycles → no deadlock
- if the graph contains a cycle
- only one instance per resource type → deadlock
- multiple instances per resource type → may or may not be deadlock

Login to unlock full content
Login Now