Skip to catalogue

187

thread pool

A fixed set of workers. Extra work waits. Unbounded thread creation is how you run out of memory.

What is thread pool?

A pool reuses a bounded number of threads or tasks. The queue in front of it must also be bounded or the pool is a costume. Pool size is a function of cores for CPU work and of downstream limits for I/O.

Why does thread pool matter when vibe coding?

Models `new Thread` per item or an unlimited task factory. Under a spike the process dies. Name the size and the rejection policy.

How do you do thread pool?

Fixed pool. Bounded queue. When full, reject. Size CPU pools near the core count. Size I/O pools by the downstream’s capacity, not by hope.

How do you ask a model for thread pool?

Use a bounded thread pool of size (N) for (work). Bound the queue. When it is full, reject. Do not create a thread or task per item.

What goes wrong with thread pool?

A pool of 200 against a database that allows 50 connections. The extra threads just wait. Size to the real limit.

adjacent