~/talk

Back to Basics: Efficient Async and Await

Talkat NDC London 2017 · 2017-01-16..01-20· [dotnet]
slides:none on file

Demonstrates why await easily deadlocks when the state machine runs on the caller thread and that Task continuations often swallow exceptions, showing a 2s Task.Delay example that returns "hello world" only if awaited correctly. Recommends returning Task instead of void, avoiding .Result/.Wait/Task.Wait, reducing unnecessary state machines by returning inner tasks, and using CancellationTokenSource for 400ms debounce smart cancellations. Concrete rules: async void crashes app, async all the way, and use ConfigureAwait(false) in ASP.NET to avoid context capture.

AI-written summary · about

  1. 0:00Start
  2. 2:16Why bother?
  3. 3:17Leverage all Resources
  4. 4:47Async + Parallel
  5. 6:35Blocking - Non Blocking Code
  6. 9:00Task Parallel Library
  7. 9:56What's a Task?
  8. 17:48private async Task RunAsync()
  9. 20:29await vs Task.ContinueWith?
  10. 21:28async & await - The Bad
  11. 26:54State Machine?
  12. 28:11Post Compilation
  13. 29:44Inside the State Machine
  14. 31:38Is it really that bad?
  15. 35:39How do we fix it?
  16. 36:18Deadlocks...
~/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.