3 ms·
async/await isn't really concurrency. It's syntactic sugar over callback hell, which can be used to write concurrent software in the "spawn something, wait for
by mathw 6y ago
async/await isn't really concurrency. It's syntactic sugar over callback hell, which can be used to write concurrent software in the "spawn something, wait for it to finish later" model. It has absolutely nothing to help you passing data between ongoing threads, accidental unlocked access to shared data etc. etc.
- unscaled 6y agoThis used to be my assumption long ago, but this is incorrect for almost every implementation async await. The compiler does not syntactically converts your awaits to callbacks - it converts everything into state machines.
- thelazydogsback 6y agoC# converts to state-machines, F# converts to nested callbacks. (Although this may change, or be optional.)
- unscaled 6y agoInteresting. The only other instance I remember of (sort-of) awaits being converted into callbacks are LiveScript "backcalls": https://livescript.net/#functions-backcalls https://livescript.net/#functions-backcalls