class Concurrent::ThreadPoolExecutor
@!macro thread_pool_executor_public_api
@!macro thread_pool_options
> scenarios.
> background thread), that preconfigure settings for the most common usage
> [FixedThreadPool] (fixed size thread pool) and [SingleThreadExecutor] (single
> [CachedThreadPool] (unbounded thread pool, with automatic thread reclamation),
> urged to use the more convenient Executors factory methods
> adjustable parameters and extensibility hooks. However, programmers are
> To be useful across a wide range of contexts, this class provides many
>
> maintains some basic statistics, such as the number of completed tasks.
> when executing a collection of tasks. Each ThreadPoolExecutor also
> of bounding and managing the resources, including threads, consumed
> due to reduced per-task invocation overhead, and they provide a means
> improved performance when executing large numbers of asynchronous tasks,
> Thread pools address two different problems: they usually provide
the official Java documentation;
‘ThreadPoolExecutor` is based on the Java class of the same name. From
configured minimum options. Should a thread crash it, too, will be garbage collected.
Threads that are idle for too long will be garbage collected, down to the
running, a new thread will be created only if the queue is full.
If there are more than `min-threads` but less than `max-threads` threads
is created to handle the request, even if other worker threads are idle.
submitted and fewer than `min-threads` threads are running, a new thread
to the bounds set by `min-threads` and `max-threads`. When a new task is
A `ThreadPoolExecutor` will automatically adjust the pool size according
they were received.
The threads in the pool remove the tasks and execute them in the order
(blocks or `proc` objects) are submitted to the pool and added to the queue.
An abstraction composed of one or more threads and a task queue. Tasks
@!macro thread_pool_executor