Async demystified
summary
Traces the evolution from APM/APM callbacks that blow up on loops (stack overflow after recursive callbacks on a 10k in-memory buffer) to Tasks (introduced in .NET Framework 4.0) and compiler-generated state machine structs (async/await in 4.5), shows the two allocations per async call — TaskCompletionSource plus its Task — and quantifies GC costs (up to 5–10% hit). Explains ValueTask (Core 2.0) and IValueTaskSource (Core 2.1 + Memory/Span overloads) that enable cached results (preallocated entries for -1..8) and zero-allocation socket paths by reusing completions.
AI-written summary · about
chapters (7)
- 0:00Introduction
- 1:44APM Pattern
- 10:12EAP Pattern
- 12:12Introduction of Tasks
- 22:04Async and Await
- 31:21Compiler Optimizations
- 38:59Value Tasks and Beyond
related talks
25mAsynchrony: Under the Hood
35mThe Multi-Threaded Asynchronous Parallel World of Swift
34mThe Art of Functional State Management
30mActually Understanding Asynchronous JavaScript
58mOptimizing Synchronous Asynchrony
53mYou Keep Using That Word: Asynchronous And Interprocess Comms
54mawait 2.0: Stackless Resumable Functions
32mThe Evolution Of Asynchronous Javascript
