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 force a program to switch to the execution of a subprogram while waiting for some resource in the main part? Moreover, how can we control the time of the subprogram's execution?