Back to Basics: Efficient Async and Await
summary
Covers practical C# async/await behavior with concrete pitfalls and fixes: demonstrates Task and Task.Run semantics, shows that never use Task.Run in ASP.NET because it consumes thread-pool threads, reproduces deadlocks caused by .Result / Wait and how awaiting avoids them, explains why avoid async void (exceptions crash the app and work can’t be observed), inspects the generated state machine, explains cancellation tokens, demos IAsyncEnumerable streaming, and recommends await top-level and prefer OS-backed async APIs over wrapping sync code.
AI-written summary · about
chapters (13)
- 0:00Efficient async await in C#
- 1:23Why async programming matters
- 8:42Task Parallel Library fundamentals
- 17:51Pitfalls with Task.Run
- 20:37Async await explained
- 25:34Converting sync to async
- 31:25Async void dangers
- 35:55Deadlocks in async code
- 44:44Skip async await for perf
- 48:57Cancellation tokens
- 51:02Async enumerables
- 56:56ConfigureAwait best practices
- 59:05Key takeaways
related talks
01h 02mBack to Basics: Efficient Async and Await
01h 15mBest Practices for Using async and await
46mAsynchronous Processing and Multithreading Are Always Fun
52mCorrecting Common Mistakes When Using Async/Await in .NET
25mNow and .then: Debugging Async JavaScript
36mTesting Asynchronous Code in Swift 5.5
45mUnit testing patterns for Concurrent code
22mHave You Heard the Joke About Async Debugging? I Promise It Is Good
