← 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 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
#2 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
#3 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
#4 Mar 30

async void is Almost Always Wrong

async void methods cannot be awaited, so exceptions thrown inside them crash the process. The only valid use case is event handlers. Use async Task everywhere else. I have personally seen this take down a production service.

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