Back to Basics: Efficient Async and Await
summary
Shows concrete C# patterns: moves heavy work off the UI thread with Task.Run, demonstrates that wrapping synchronous methods in tasks causes cross-thread UI bugs and swallowed exceptions, proves async void loses exception handling and that changing to async Task lets callers await errors. Explains deadlocks caused by blocking with .Result/.Wait, shows using Task.WhenAll to parallelize I/O, and demos IAsyncEnumerable with CancellationToken to stream lines successfully from disk.
AI-written summary · about
chapters (12)
- 0:00Start
- 5:43The Task Parallel Library
- 18:35Considerations
- 19:14Validate the Tasks
- 20:09Async and Wait
- 32:44State Machine
- 38:48Deadlocks
- 45:56Avoid Introducing Unnecessary Code
- 53:22Long Running Operation
- 55:04Asynchronous Operations with Databases
- 55:59Async Enumerable
- 56:57Enumerator Cancellation
related talks
01h 01mBack 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
45mUnit testing patterns for Concurrent code
36mTesting Asynchronous Code in Swift 5.5
02h 42mSwift Structured Concurrency
52mxUnit Expanded – Better Testing With xUnit
