org.apache.cassandra.concurrent

## Class SharedExecutorPool

- java.lang.Object
- - org.apache.cassandra.concurrent.SharedExecutorPool

- Direct Known Subclasses:
    JMXEnabledSharedExecutorPool

      public class SharedExecutorPool
      extends java.lang.Object

  A pool of worker threads that are shared between all Executors created with it. Each executor is treated as a distinct unit, with its own concurrency and task queue limits, but the threads that service the tasks on each executor are free to hop between executors at will. To keep producers from incurring unnecessary delays, once an executor is "spun up" (i.e. is processing tasks at a steady rate), adding tasks to the executor often involves only placing the task on the work queue and updating the task permits (which imposes our max queue length constraints). Only when it cannot be guaranteed the task will be serviced promptly does the producer have to signal a thread itself to perform the work. We do this by scheduling only if The worker threads schedule themselves as far as possible: when they are assigned a task, they will attempt to spawn a partner worker to service any other work outstanding on the queue (if any); once they have finished the task they will either take another (if any remaining) and repeat this, or they will attempt to assign themselves to another executor that does have tasks remaining. If both fail, it will enter a non-busy-spinning phase, where it will sleep for a short random interval (based upon the number of threads in this mode, so that the total amount of non-sleeping time remains approximately fixed regardless of the number of spinning threads), and upon waking up will again try to assign themselves an executor with outstanding tasks to perform.

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `SharedExecutorPool(java.lang.String poolName)`

  - ### Method Summary

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### SharedExecutorPool

          public SharedExecutorPool(java.lang.String poolName)

Copyright © 2014 The Apache Software Foundation