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

Sign in to watch this lesson
The STL from the Inside · 3:28
A coroutine is a function that can hand back a value, pause, and pick up later with its locals intact. We see why an ordinary stack frame can't do that, build a Fibonacci generator with co_yield and a hand-written promise_type (std::generator is C++23 and missing on the Mac), measure its 56-byte frame (which clang removes entirely at -O2), interleave two coroutines on one thread, and compare that frame with a thread's 512 KB stack.