Package io.airlift.concurrent
Class BoundedExecutor
java.lang.Object
io.airlift.concurrent.BoundedExecutor
- All Implemented Interfaces:
Executor
Guarantees that no more than maxThreads will be used to execute tasks submitted
through
execute().
There are a few interesting properties:
- Multiple BoundedExecutors over a single coreExecutor will have fair sharing of the coreExecutor threads proportional to their relative maxThread counts, but can use less if not as active.
- Tasks submitted to a BoundedExecutor is guaranteed to have those tasks handed to threads in that order.
- Will not encounter starvation
-
Constructor Summary
Constructors -
Method Summary