Abstract


  • A fixed-number group of Thread that are reused to execute tasks submitted to Task Queue by a client. The number of Thread is usually the number of cores the system has. Less will lead to wasted CPU power, more will introduce Context Switch which has overhead, unless the task isn’t cpu-bounded
  • Commonly used in scenarios where tasks are small, numerous, and independent(stateless). Examples include web servers handling HTTP requests and applications that perform many asynchronous I/O operations

Task Queue


  • Tasks that need to be executed are placed in a queue
  • When a Thread becomes available, it pulls a task from the queue and executes it
  • After completing the task, the thread returns to the pool to await the next assignment