thread pool

A fixed or bounded set of reusable worker threads that take tasks from a queue, instead of creating a new thread for each task.

In more detail

Reusing threads avoids the cost of creating them and caps how much work runs at once, protecting memory and the processor. Web servers often serve requests from a pool, so a pool thread blocked on slow I/O is wasted capacity. Size a pool from the expected load and the kind of work it runs.

Examples

ASP.NET Core serves every request from the .NET thread pool.
Executors.newFixedThreadPool(2)
libuv keeps four threads by default for file system calls, DNS lookups and crypto such as pbkdf2; Piscina provides worker thread pools for CPU-heavy JavaScript.

Related terms

Taught in

References

Certification courses