C# Deadlocks, SynchronizationContext and ConfigureAwait
We reproduce the .Result deadlock for real with our own single-threaded SynchronizationContext and stop it with a watchdog. How await captures the context and Posts to it, why it does not hang in a console app or ASP.NET Core but risks thread pool starvation, async all the way, ConfigureAwait(false) in library code, the thread that does not change on a completed task, and the price of wrapping with Task.Run.
7 Nov 2026
·
9 min
·
4