~/talk

Everything You (Don’t) Want to Know About Async and Await in C#

Talkat JetBrains .NET Days Online 2025 · 2025-10-08..10-09· [concurrency, dotnet]
slides:none on file

Deep dive into how C# rewrites async/await into a compiler-generated state machine: demos show Task.Delay(500/1000ms), printed thread IDs, and live polls (≈41–48 votes) that reveal a console app has no SynchronizationContext so continuations go to the thread pool (configureAwait has no effect there). Covers exception surfacing via GetResult, three task terminal states, cooperative cancellation patterns, async streams with cancellation, pitfalls of async void and ValueTask, and a working custom awaiter for Control.Dispatcher to marshal back to UI.

AI-written summary · about

  1. 0:00Introduction and motivation
  2. 2:20Async/await fundamentals
  3. 5:05Control flow in async methods
  4. 12:00Task combinators and parallelism
  5. 14:40Under the hood: The state machine
  6. 23:40Task states and exception handling
  7. 27:20Cooperative cancellation
  8. 31:50Advanced task patterns
  9. 40:20Custom awaitables
  10. 50:40Async streams and disposal
  11. 56:30Reporting progress
  12. 58:50Context and ConfigureAwait
~/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.