Skip to main content

How does .NET ThreadPool schedule work?

Expert .NET Core
Quick Answer The ThreadPool maintains a global work-stealing queue and per-thread local queues. Threads steal from each other when idle. A hill-climbing algorithm adjusts thread count based on throughput (measured every ~15ms). For long-running CPU work (> ~500ms), use TaskCreationOptions.LongRunning to get a dedicated non-pool thread.

Answer

ThreadPool uses global/per-thread queues, work stealing, and hill-climbing to adjust worker counts. Long-running tasks should use LongRunning to avoid blocking worker threads.

S
SugharaIQ Editorial Team Verified Answer

This answer has been peer-reviewed by industry experts holding senior engineering roles to ensure technical accuracy and relevance for modern interview standards.

Want to bookmark, take notes, or join discussions?

Sign in to access all features and personalize your learning experience.

Sign In Create Account

Source: SugharaIQ

Ready to level up? Start Practice