C# › Asynchronous Programming

How do you design for scalability and avoid thread-pool starvation?

Advanced

Answer

Use async I/O so request threads return to the pool while waiting; never block on async (sync-over-async) as it holds threads and starves the pool under load.
public async Task<IActionResult> Get() => Ok(await _repo.GetAsync());
Real-world example Removing blocking .Result calls let a checkout API handle far more concurrent users.