This article from the csdn blog, reproduced please indicate the source: http://blog.csdn.net/wdswei/archive/2009/09/27/4597930.aspx
Summary
In-depth research on Microsoft. the thread pool provided by. Net to reveal under what circumstances you need to use the thread pool and. net Framework, and shows you how to use the thread pool.
Content
Introduction
. Net Thread Pool
Functions executed in the thread pool
Use Timer
Synchronization object execution
Asynchronous I/O operations
Monitor thread pool
Deadlock
Security
End
Introduction
If you have multi-threaded programming experience in any programming language, you must be very familiar with some typical examples. In general, multi-threaded programming is associated with applications based on user interfaces. They need to perform time-consuming operations without affecting end users. Take out any reference book and open the thread chapter: Can you find a Multithread example that can execute mathematical operations in parallel on your user interface?
My goal is not to let you throw your book. Don't do this! Multi-threaded programming technology makes applications based on user interfaces more perfect. In fact, the Microsoft. NET Framework supports the application of multi-threaded programming technology in Windows written in any language, allowing developers to design rich interfaces and provide end users with a better experience. However, the multi-threaded programming technology is not only for user interface applications, but also for applications without any user interface, there will be multiple execution streams.
We use a "hardware store" customer/server application system as an example. The client is a cash register, and the server is an application system running on an independent machine in the warehouse. You can imagine that the server does not have any user interface. How can you implement it without multithreading?
The server receives and processes requests from the client through channels (HTTP, sockets, files, and so on), and then sends a response to the client. Figure 1 shows how it works.