Two Counts on One Page¶
Exercise: 38k_semaphores · Thu Oct 29 · Length: 5:13 · Lecture: Week 10 · Semaphores and the heap · Explainer: Two Counts on One Page
A narrated walk through the explainer, for after the Oct 27 lecture and before
Thursday's session: an Arc<Semaphore> lives on one heap page, which the heap
takes from the page allocator. The video steps through the block's strong
count and permit count as owners are made, permits are taken and refused, one
comes back, and the owners drop. Two broken cases follow, with what the test
printed for each in a real run: a wait with no zero check, and a wait that
locks the count twice. The video ends on what you write and how to read the
line the test prints. It shows no solution code: only the block's words, the
owners and the free list, with numbers that are examples, not the lecture's.
Download the video (MP4, 7 MB) · Captions (WebVTT) · All five Week 10 videos