Await/Async, part deux

I can't make sense of this. If await in A1 (or what I and apparently several others have referred to as await! without but a handwaving definition) – if that await would not block its thread of execution then where would that thread continue running on? Say the main thread gets "parked" to wait for a non-async function call an async function, where's the continuation point to jump to, and what makes the main thread jump back to this function when it's ready to resume?

For func A2 async I can see how an executor system partly in the language, partly in its stdlib, could turn those into running code with cooperative switching, but A1 is supposed to act as an ordinary function.

4 Likes