This week's book giveaway is in the OO, Patterns, UML and Refactoring forum. We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line! See this thread for details.
A thread pool is a collection of worker threads that efficiently execute asynchronous callbacks on behalf of the application. The thread pool is primarily used to reduce the number of application threads and provide management of the worker threads.
What is difference between worker thread and application thread?
An application thread is a thread that is associated with the running application. In other words, you will have to wait for a completion of a task which is being handled by an application thread. Using the thread pooling pattern, you can use worker threads to do the tasks in background. In other words, a worker thread is a background thread, and often possibly a daemon thread. It runs behind the background of the application without affecting the workflow of the application. It waits for the tasks, and when a task is ready for the execution, it will be executed. The application doesn't have to wait for a worker thread. For an example, the thread that runs the Java Garbage Collection mechanism is a worker thread.
Don't read too much into the distinction between worker threads and application threads.
Both do the work of the application. Worker generally refers to a thread that is launched
or controlled by another thread; a thread that is low on the hierarchy. Application threads
kind of run the show, bossing the workers around.