O'Reilly logo

.NET Common Language Runtime Unleashed by Kevin Burton

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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 ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required