C++ Coroutine ~ Deep dive

What is a Coroutine?

Maharajan Shunmuga Sundaram

--

A normal function can be invoked. Once the function is completed, it returns the return value or throws exception. All its local variables are destroyed except static variables. Once the function returns, the caller can continue the execution from where it left.

A coroutine can also be suspended and resumed. This is very different from normal routine. When the coroutine is suspended, it remembers its state and it can restart from where exactly suspended once resumed. The state of the suspension point including program…

--

--