Upgrade to Pro — share decks privately, control downloads, hide ads and more …

The Async Invasion

The Async Invasion

Why so many languages are adopting async/await, and why that's a good thing.

Stephen Cleary

June 23, 2018
Tweet

More Decks by Stephen Cleary

Other Decks in Programming

Transcript

  1. StephenCleary.com async Future // In the Real World, we would

    actually do something... await Future async await yield
  2. StephenCleary.com async Future // In the Real World, we would

    actually do something... await Future await async Future Future Future await
  3. StephenCleary.com async Future // In the Real World, we would

    actually do something... await Future await
  4. StephenCleary.com Next: • C++ (n4680 Coroutines) – C++20? • Kotlin

    (experimental coroutines in 1.1) • Rust (nightly since 2017-08) Timeline
  5. StephenCleary.com User mode Kernel mode My code OS Device driver

    OVERLAPPED IRP ISR APC blog.stephencleary.com/2013/11/there-is-no-thread.html State: Created. State: In progress. State: Complete.
  6. StephenCleary.com User mode Kernel mode My code OS Device driver

    Thread IRP ISR APC blog.stephencleary.com/2013/11/there-is-no-thread.html State: Created. State: In progress. State: Complete/Running. State: Blocked.
  7. StephenCleary.com Client Server Primary benefit: Responsiveness Primary benefit: Scalability Keep

    UI thread free Minimize threads used to serve requests Better UX 10x-100x scalability (same box) Required by many app stores Faster response to bursting traffic