Using the thread pool
As already mentioned, creating a thread is quite an expensive operation. In addition to this, creating more and more threads is not efficient. To make asynchronous operations easier, in Common Language Runtime there is a thread pool, which is represented by the
System.Threading.Threadpool class. Instead of creating a thread every time we need one, we ask the thread pool for a worker thread. If it has a thread available, a thread pool returns it to us. When its job is done, it goes back into the thread pool in a suspended state until it is needed again.
There are two types of threads inside the thread pool: worker threads and input/output threads. I/O threads are used for asynchronous I/O processing and we are not going to ...