Thread pool

[2] Another good property - the ability to limit system load, when we use fewer threads than available.

The number of available threads is tuned to the computing resources available to the program, such as a parallel task queue after completion of execution.

Creating and destroying a thread and its associated resources can be an expensive process in terms of time.

However, thread pools are conceptually related to server farms in which a master process, which might be a thread pool itself, distributes tasks to worker processes on different computers, in order to increase the overall throughput.

[disputed – discuss] The cost of having a larger thread pool is increased resource usage.

A sample thread pool (green boxes) with waiting tasks (blue) and completed tasks (yellow)