The thread pool can better control the running status of a series of threads. Msdn reference
Http://msdn.microsoft.com/zh-cn/library/3dasc8as (vs.80). aspx
Here, Ms clearly describes threadpool, but its example is too simple. It just briefly introduces how to use a semaphore array to control the members of the thread pool. A better example is provided in the Introduction Document of threadpool. getmaxthreads.
Http://msdn.microsoft.com/zh-cn/library/system.threading.threadpool.getmaxthreads (vs.80). aspx
This example is difficult for beginners who have not been deeply involved in reading and writing threads or files, but I suggest you try to figure out each line of code in it. This example shows that an auxiliary thread is called manually, and two Io threads are called asynchronously through filestream. "And according to the speed and number of computer processors, write operations are processed by one or two port threads"
The two filewriter. beginwrite are called in turn and will be queued in the thread pool. If there are not enough Io threads, the two may not necessarily be concurrent.