Queue prediction and shutdown practice
- Draw the four combinations of open/closed and empty/nonempty. For each, predict get behavior; add full versus nonfull for put.
- Trace a consumer notified about an item that another consumer removes first. Explain why an if-check fails without requiring a spontaneous wakeup.
- Fill a capacity-two queue with a,b; block a producer adding c; close. Predict which items drain and which operation raises Closed.
- Reverse an overlapping put/close order at their linearization points. Explain why both outcomes can be valid and why logging order can mislead.
- Enumerate two increments as read/write steps. Identify the four lost-update schedules and why locking only writes is insufficient.
- Propose a shutdown test with three consumers already waiting on empty. State which synchronization evidence establishes they reached wait, and why sleep alone does not establish it.
Keep predictions before execution and retain any mistaken model. After 48 hours, repeat with a different capacity and a new closing schedule. Explain which claims require fairness, reliable external processing or durability beyond this queue.