This week introduces synchronization, critical sections, mutual exclusion, locks, spinlocks, condition variables, and basic producer-consumer coordination.
Week 5 addresses the correctness problems caused by concurrent execution. Students learn how locks protect shared state and how condition variables allow threads to wait for events.
| Time | Activity | What Students Do | Link |
|---|---|---|---|
| Before Lecture | Preparation Reading | Read OSTEP Chapters 28–30 and identify one real example of shared data. | Book → |
| Lecture 1 | Critical Sections and Locks | Race conditions, atomicity, mutual exclusion, lock acquire/release, and lock correctness. | Slides → |
| Lecture 2 | Condition Variables | Waiting, signaling, producer-consumer patterns, and avoiding busy waiting. | Slides → |
| Lab Session | Synchronization Lab | Protect a shared counter using mutexes and coordinate threads using condition variables. | Lab → |
| After Lecture | Assignment 5 | Implement a bounded buffer with producer and consumer threads. | Assignment → |
| End of Week | Quiz 5 | Complete short quiz on critical sections, locks, mutexes, condition variables, and producer-consumer coordination. | Quiz → |
Identify race conditions, protect critical sections using mutex locks, use condition variables, and explain why synchronization is required.
Slides for synchronization and locks. Replace this placeholder with your final PDF or Google Slides link.
Instructor notes and class summary for review after lecture and before assessment.
Placeholder for lecture recording or external video link. Replace this href with YouTube, Blackboard, or local recording URL.
Starter files, examples, and templates for the Week 5 lab and assignment.
Complete the assigned reading before lecture. Focus on definitions, mechanisms, tradeoffs, and examples that connect to the lab.
Use this reference to look up commands, system calls, library calls, and Linux behavior related to this week.
Protect a shared counter using mutexes and coordinate threads using condition variables.
Implement a bounded buffer with producer and consumer threads. Submit source code, screenshots, and a short explanation.
Short quiz covering critical sections, locks, mutexes, condition variables, and producer-consumer coordination.
Central download area for slides, notes, lab, assignment, starter code, and reference files. Replace placeholder paths after uploading final files.
Week 6 focuses on deadlocks. Students should understand locks before studying what happens when locks are used incorrectly.