| ||||
Copyright 1999 Sams Publishing |
|
Summary |
Thread pooling can be used when a thread is needed for a relatively short time. Thread pooling allows a thread to be assigned to a task and, when the task completes, to be recycled for use in another task. Because threads in the pool are already up and running, response time is usually reduced. The number of threads in the pool can be fixed to an upper limit to prevent a sudden overloading of the application. |
I showed you how to create a generic pool of threads to execute the run() method of objects that implement the Runnable interface. Then, I showed you how to create a specialized pool of threads to service HTTP requests . Both these techniques can be elaborated on to provide more specialized and robust solutions in your code. |
| |||
Toc |