Raymond Chen: All of C++'s async machinery runs on one hidden class
C++ futures part 1: The mental model
Raymond Chen breaks down std::promise, std::packaged_task, std::async, std::future, and std::shared_future by revealing they all rest on a single unnamed shared state he calls the "source" — a struct with a mutex, a condition variable, and a union holding either a value or an exception. He sketches a simplified implementation showing how values and exceptions go in, how waiters block, and how results get consumed, then promises to build the rest on top next time.
I'm writing the series because I always forget how it works, but writing it down helps me remember.