C# Interview Question #147
What is thread-pool starvation?
Advanced Async, Parallelism & Threading Senior Advanced
Quick Interview Answer
Thread-pool starvation occurs when available worker threads are occupied or blocked faster than the runtime can make threads available for new work.
Detailed Explanation
Thread-pool starvation occurs when available worker threads are occupied or blocked faster than the runtime can make threads available for new work.
Symptoms can include high latency, queued work, poor throughput, and requests that appear to stall even when CPU utilization is not fully saturated.
Common causes include synchronous blocking on asynchronous operations, long-running blocking calls, excessive Task.Run usage, lock contention, and slow synchronous I/O.
The solution is usually to remove unnecessary blocking, use asynchronous I/O end-to-end, reduce contention, and diagnose the application using runtime counters, traces, and profiling tools.