Save this video — free

ECE344 Fall 2026 (Sec 1) Lec 16 - Locks

Jon Eyolfson · 43:54 · Watch on YouTube

ECE344 Fall 2026 (Sec 1) Lec 16 - Locks Watch on YouTube →

Overview

Jon Eyolfson explains how data races arise when threads update shared memory and how mutexes protect critical sections. Using an eight-thread counter that should reach 8 million, he models `counter++` as a load, add, and store; explores possible interleavings and GCC GIMPLE; then shows why a plain-C check-then-set lock is unsafe and wastes CPU while spinning.

Key takeaways

Chapters

0:00 The Lost Increments Behind the 8-Million Counter
8:00 Data Races, Atomic Operations, and GCC GIMPLE
14:30 Enumerating Interleavings for Two Counter Increments
17:30 Using a POSIX Mutex to Protect a Critical Section
23:00 Choosing Critical-Section Size and Lock Placement
28:15 Lock Correctness: Safety, Progress, and Bounded Waiting
32:00 Why Disabling Interrupts Is Not a General User-Space Lock
33:00 The Plain-C Check-Then-Set Lock Fails

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.