Red and blue functions are a good thing
You never have such issues in well-designed programs with a main event loop where all possible events are waited on. Your program is either idle, or waken up by a set of events (any kind of IO, a timeout, or a signal from another thread). You handle all events by dispatching them in a timely manner to the responsible code, and wait again. Of course you need non-blocking APIs or dedicated threads for the IO and compute-intensive stuff.<p>The whole async&#x2F;await thing is just a convenience feature that looks great but distracts you from thinking about the true concurrency of your program.