~/talk

Best Practices for Using async and await

Talkat JetBrains .NET Days Online 2021 · 2021-05-11..05-12· [dotnet, testing]
slides:none on file

Shows concrete bugs and fixes: an async void breaks code pattern causes uncaught exceptions and race conditions until inner methods return Task and callers await them; calling task.Result produces a reproducible deadlock on the UI thread; adding Task.Delay as a “fix” provokes races; using ConfigureAwait(false) prevents some deadlocks but then requires explicit marshalling back to the UI or synchronization context to access controls. Demonstrations use four .NET Core WPF sample apps and code is on GitHub (damirarh/jbdnd-async-await).

AI-written summary · about

  1. 0:00Introduction
  2. 4:42Synchronous vs. asynchronous
  3. 13:23async void breaks asynchronous code
  4. 31:52Deadlocks
  5. 42:18ConfigureAwait(false)
  6. 49:50SynchronizationContext
  7. 55:07Summary
  8. 59:20Q&A
~/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.