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

Sign in to watch this lesson
Waiting and Signalling · 4:20
A future is a one-shot channel: a promise (or a packaged_task) writes a value or an exception into a shared state on the heap, and get() hands it over once. We watch exceptions and broken promises cross threads, run the book's GUI-thread task queue, compare std::async launch policies, catch the blocking destructor of an async future (two fire-and-forget calls took 400 ms instead of 200), and measure what a future and an async launch really cost on a Mac.