Nowadays, plenty of embedded devices still have only a single core. Developers write for those devices, trying to squeeze maximum performance out of them. Using
Boost.Threads or some other thread library for such devices is not effective; the OS will be forced to schedule threads for execution, manage resources, and so on, as the hardware cannot run them in parallel.
So how can we make a program switch to the execution of a subprogram while waiting for some resource in the main part?
Basic knowledge of C++ and templates is required for this recipe. Reading some recipes about
Boost.Function may also help.
This recipe is about coroutines, subroutines that allow multiple ...