Class UnfairExecutor.TaskHashXorTimeStripeGenerator

  • All Implemented Interfaces:
    UnfairExecutor.TaskStripeGenerator
    Enclosing class:
    UnfairExecutor

    public static class UnfairExecutor.TaskHashXorTimeStripeGenerator
    extends java.lang.Object
    implements UnfairExecutor.TaskStripeGenerator
    Generator which will determine the task stripe by using the identity hash of the runnable and Clock.lastKnownTimeNanos(). This is the fastest built in option, however submissions of the same task many times without the clock being updated can result in a single thread being unfairly burdened. Because of that it is highly recommended to over-size your pool if you are using this distributor.

    A possibly more fair, but slower stripe generator would be UnfairExecutor.AtomicStripeGenerator.

    This class should not be constructed, instead it should be provided via the static function instance().

    Since:
    4.5.0