~/talk

Correcting Common Async/Await Mistakes in .NET 8

Talkat NDC London 2024 · 2024-01-29..02-02· [dotnet, concurrency]
slides:none on file

Claims that the C# compiler lowers async methods into generated state‑machine structs with a hidden try/catch (so unawaited tasks can silently swallow exceptions) and that each async adds about 80 bytes in .NET 8. Shows debugging with SharpLab, a refactor of a Hacker News app that replaces serial requests with IAsyncEnumerable + parallel Task.WhenAny, uses safe fire and forget extension and ValueTask, and reports smaller app size, fewer swallowed exceptions, and measurable runtime speed-ups.

AI-written summary · about

  1. 0:00Async/await in .NET 8
  2. 1:10How async/await works
  3. 10:15Awaiting tasks is critical
  4. 13:46Refactoring Hacker News app
  5. 20:08Fixing async void in constructors
  6. 22:12UI thread await efficiency
  7. 30:45Avoid Task.Delay and ConfigureAwaitOptions
  8. 35:01IAsyncEnumerable for streaming
  9. 41:45Optimizing with ValueTask
  10. 46:42Async/await best practices
  11. 54:55Resources and closing
~/search
type to search 6,249 conferences, 138,987 speakers and 185,172 talks
~/help
cmdctrl k
search every conference, speaker and series
/
focus the filter search
h
home
c
conferences
s
speakers
e
series
t
light / dark — the status bar button does the same
?
this help
esc
close this, then clear every filter — or just the search, while you are typing in it

Ignored while you are typing. Pages without a filter rail have no search to focus.