CSE 513
CSE 513 · GEBZE TECHNICAL UNIVERSITY

Deadlocks and resource allocation

Lecture set 04 · Semester week 4

The central question

When can processes wait forever, and what can we do about it?

First half

Necessary conditions; resource-allocation and wait-for graphs; deadlock, starvation and livelock.

Second half

Prevention, avoidance, detection and recovery; a safe-state example; practical lock ordering.

What you should be able to do

  • Recognize the conditions that permit deadlock.
  • Reason through a resource graph or safe-state example and compare remedies.

A concrete example

Revisit dining philosophers as a resource graph and show how changing one rule breaks the cycle.

Reading reference

Operating System Concepts, 10th edition: Chapter 8. We use selected sections rather than every slide in each chapter.

Official textbook slides

Lecture materials

Read the Week 4 chapter with resource graphs, worked safety calculations, detection and optional C practice.

Read Deadlocks and resource allocation →

Download lecture slides (PDF, 74 slides)

Search CSE 513