~/talk

Correcting Common Async/Await Mistakes in .NET

Talkat NDC Oslo 2019 · 2019-06-17..06-21· [dotnet, concurrency]
slides:none on file

Shows that the C# compiler turns async methods into IAsyncStateMachine classes (about 100 bytes overhead) and that the generated MoveNext wrapped in try/catch can hide exceptions when tasks are not awaited. Live refactors a Xamarin Hacker News app: replace .Wait/.Result with await or GetAwaiter().GetResult to avoid deadlocks and AggregateException, use ConfigureAwait(false) to skip context switches, return Task instead of async/await to skip the state machine, use ValueTask for hot paths and a safe fire-and-forget extension; demos and NuGet packages prove the fixes reduce allocations, expose exceptions, and speed execution.

AI-written summary · about

  1. 0:00Start
  2. 0:10Correcting Common Async/Await Mistakes in .NET
  3. 2:15Multi Threading
  4. 14:07Quick Review
  5. 14:24Await Every Task
~/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.