← Back to /cs/

async/await common mistakes I keep seeing in production_

A collection of async/await anti-patterns that cause deadlocks, thread pool starvation, and mysterious hangs.

By: bob_codes Mar 29, 2026 5 posts
#1 Mar 29

The Deadlock Classic: .Result and .Wait()

The most common async bug I see is calling .Result or .Wait() on a Task inside an async method running on a synchronization context. This deadlocks 100% of the time in ASP.NET Framework and WinForms. Always use await instead.

By: bob_codes Mar 29, 2026 18:39
#2 Apr 02

Stickied: Required Reading

Pinning Stephen Cleary's blog series on async as required reading for this thread. It is the definitive guide on not blocking on async code in C#.

By: ByteMod Apr 02, 2026 18:39
#3 Apr 01

Do Not Use Task.Run for I/O Bound Work

Task.Run is for CPU-bound work. Wrapping a synchronous I/O call in Task.Run does not make it truly async — you just burn a thread pool thread while waiting. Use truly async APIs: HttpClient, EF Core async methods, Stream.ReadAsync, and so on.

By: alice_dev Apr 01, 2026 18:39
#4 Mar 31

ConfigureAwait(false) in Libraries

If you are writing a library (not application code), always use .ConfigureAwait(false) on every await. This avoids capturing the synchronization context and prevents deadlocks in callers who have not gone fully async yet.

By: dave_runtime Mar 31, 2026 18:39
[1] [2] Page 1 of 2 (5 posts)
5 posts in this thread [+] Reply