ThreadPool not starting new Thread instantly

The ThreadPool is specifically not intended for long-running items (more specifically, you aren’t even necessarily starting up new threads when you use the ThreadPool, as its purpose is to spread the tasks over a limited number of threads).

If your task is long running, you should either break it up into logical sections that are put on the ThreadPool (or use the new Task framework), or spin up your own Thread object.

As to why you’re experiencing the delay, the MSDN Documentation for the ThreadPool class says the following:

As part of its thread management strategy, the thread pool delays before creating threads. Therefore, when a number of tasks are queued in a short period of time, there can be a significant delay before all the tasks are started.

You only know that the ThreadPool hasn’t reached its maximum thread count, not how many threads (if any) it actually has sitting idle.

Leave a Comment