Introduction
In the previous chapters, we discussed several ways to create threads and organize their cooperation. Now, let's consider another scenario where we will create many asynchronous operations that take very little time to complete. As we discussed in the Introduction section of Chapter 1, Threading Basics, creating a thread is an expensive operation, so doing this for each short-lived, asynchronous operation will include a significant overhead expense.
To deal with this problem, there is a common approach called pooling that can be successfully applied to any situation when we need many short-lived, expensive resources. We allocate a certain amount of these resources in advance and organize them into a resource pool. Each time we need a new resource, we just take it from the pool, instead of creating a new one, and return it to the pool after the resource is no longer needed.
The .NET thread pool is an implementation of this concept. It is accessible via the System.Threading...