Skip to main content

Bounded queues, wakeups and graceful close

This required 22–32-hour package replaces the former three-hour queue exercise: lessons and prediction 6–8, implementation and controlled experiments 10–16, assessment and delayed repair 6–8. Estimates are author planning assumptions awaiting learner pilots. Original atomics, semaphores, readers/writers, deadlock, lock-free and async practice remains required. See the reconciled semester workload.

Prerequisite bridge​

Bring Module 1's distinction between a schedule and a timing measurement, Module 2's separation of shared state from cached assumptions, and Semester 04's ownership reasoning. Before coding, draw a capacity-two FIFO, explain which fields need the same lock, and trace close with one remaining item. Use 1–2 hours within lessons to repair gaps.

Learning sequence​

  1. Predicates and wakeups.
  2. Close and linearization.
  3. Concurrency evidence.
  4. Prediction practice, runnable lab, CQ1–CQ6 gates and calibration.

Selective primary resources​

Use OSTEP Condition Variables for the relationship between waiting, state and locking, then return to the original exercises here. Use Python Condition documentation for the actual wait/notification API contract. Both were checked on 2026-10-23. Existing OSTEP, Operating System Concepts and pthread selections remain the book backbone; no purchase is required.

The original Python queue uses locks rather than depending on interpreter scheduling or the GIL. It is a learning artifact, not a replacement for a production queue library. The evidence distinguishes removal from a queue from reliable processing of work.