Save this video free

ECE344 Fall 2026 (Sec 1) Lec 18 - Semaphores

Jon Eyolfson · 57:00 · Watch on YouTube

ECE344 Fall 2026 (Sec 1) Lec 18 - Semaphores Watch on YouTube →

Overview

Jon Eyolfson distinguishes mutexes, which provide mutual exclusion and prevent data races, from semaphores, which coordinate event order through atomic waits and posts. He builds ordered-print examples and a bounded-buffer producer-consumer solution using counting semaphores for filled and empty slots, while retaining mutexes to protect shared indices.

Key takeaways

Chapters

0:00 Locks, Data Races, and Thread Ordering
8:30 Why Two Created Threads Do Not Print in Order
13:00 Why a Shared Flag or Mutex Is Not a Signaling Solution
19:00 Thread-Safe Output and the Cost of Joining Early
23:00 Semaphore Operations, Initial Values, and POSIX API
26:30 Enforcing Ordered Print with a Zero-Count Semaphore
34:00 Chaining Three Messages and Choosing Mutexes Versus Semaphores
39:30 Bounded Circular Buffer: Producer and Consumer Requirements
45:00 Counting Filled Slots to Block Premature Consumption
49:00 Counting Empty Slots to Prevent Producer Overwrites
55:00 Protecting Buffer Indices and Avoiding Deadlock

Keep these chapters and the full searchable transcript in your own library.

Summary, takeaways, and chapters were generated by AI from the video's transcript and may contain errors. The video belongs to its creator, Jon Eyolfson.

Want the full transcript?

Save this video in YouTube Collector to get its complete searchable transcript, your own AI summaries, and a library that keeps every video you collect in one place.