Thread Pool
Now you have AppDomains that have been described as lightweight processes, and Threads that are contained in AppDomains. It is time to introduce a lighter still Thread that is spawned from the ThreadPool class. Starting up a Thread takes little overhead, but even a little overhead is some overhead. Starting a Thread from a pool of Threads removes much of the startup costs associated with starting a Thread from scratch. The Thread is queued, and the system (the CLR) determines when and with what resources it should be run.
QueueUserWorkItem
The Thread that is queued by QueueUserWorkItem is part of a pool and it can be assigned to some other work immediately after completing the work that you assigned it to do. Therefore, you are not ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access