Coroutines: More Details
This lesson clarifies more details regarding coroutines, including use-cases, design goals, and underlying concepts.
We'll cover the following...
Typical Use-Cases
Coroutines are the natural way to write event-driven applications; e.g. simulations, games, servers, user interfaces, or even algorithms. Coroutines are typically used for cooperative multitasking. The key to cooperative multitasking is that each task takes as much time as it needs. This is in contrast to pre-emptive multitasking, for which we have a scheduler that decides how long each task gets the CPU.
That being said, there are different kinds of coroutines.
Underlying Concepts
Coroutines in C++20 are asymmetric, first-class, and stackless.
The workflow of an asymmetric coroutine goes back ...