Get the latest tech news
Asynchrony is not concurrency
Yes I know about that one talk from Rob Pike.
I won’t get into the weeds of a stackless coroutines implementation, but the core principle is the exact same: designing a yielding primitive that lets you switch tasks. In this case the two different calls to saveData can be scheduled concurrently because they are asynchronous to one another, and the fact that they don’t express any internal asynchrony does not compromise the execution model. This documents in the code that concurrency is required for correctness, which will also let the program error out when attempting to run it over a non-concurrent Io implementation.
Or read this on Hacker News