Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

worker thread

 
abalfazl hossein
Ranch Hand
Posts: 635
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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?
 
Devaka Cooray
ExamLab Creator
Marshal
Pie
Posts: 4682
333
Chrome Eclipse IDE Google App Engine IntelliJ IDE jQuery Postgres Database Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Jim Hoglund
Ranch Hand
Posts: 525
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.

Jim ... ...
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic