O'Reilly logo

Microsoft® .NET Compact Framework Kick Start by Ronnie Yates, Erik Rubin

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

Managing Multiple Threads with a Thread Pool

There are many real-world situations where the use of a thread makes sense but the thread's lifetime is short. For example, an architect might choose to spawn a thread to handle a short-lived socket connection to a remote party. Suppose the application has an average of 5 such connections occurring simultaneously, but each connection lasts an average of only 1 minute. In that case the application could easily spawn over 100 threads per hour, even though it really only needed 5 at a time.

This kind of behavior is wasteful and expensive and can be especially harmful on devices, with their limited resources. Particularly with devices, developers should always be stingy with resource allocation.

The .NET ...

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