Price your future right. 60% off with code BLACKSCHOLES at USD checkout. Offer ends in 8d 09h 54m 20s8 days 9 hours 54 minutes 20 seconds.
Price your future right. 60% off with code BLACKSCHOLES at USD checkout. Offer ends in 8d 09h 54m 20s8 days 9 hours 54 minutes 20 seconds.

Sign in to watch this lesson
Waiting and Signalling · 4:38
The bounded buffer is where condition-variable bugs live. We run the operating systems book's first version on a Mac with one producer and two consumers and watch it freeze in every run because one condition variable wakes the wrong thread, fix that with separate empty and fill conditions, then hit the if-instead-of-while bug that Mesa semantics makes inevitable. Finally we measure the cost of broadcasting and how much a bigger buffer saves.