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

Sign in to watch this lesson
Waiting and Signalling · 4:25
We wrap a mutex, a condition variable and a std::queue into Williams' threadsafe_queue, with push, wait_and_pop and try_pop, so callers can no longer get the waiting rules wrong. On a Mac we reproduce the book's lost wakeup when the woken consumer's make_shared throws, fix it by storing shared_ptr, see why a wait_for loop has no time bound while wait_until does, and measure what a single mutex does to throughput.