public class BackoffIdleStrategy extends Object implements IdleStrategy
Thread.yield()for maxYields, then
LockSupport.parkNanos(long)on an exponential backoff to maxParkPeriodNs
|Constructor and Description|
Create a set of state tracking idle behavior
public BackoffIdleStrategy(long maxSpins, long maxYields, long minParkPeriodNs, long maxParkPeriodNs)
maxSpins- to perform before moving to
maxYields- to perform before moving to
minParkPeriodNs- to use when initiating parking
maxParkPeriodNs- to use when parking
public boolean idle(long n)
n- number of times this method has been previously called with no intervening work done.
Copyright © 2016 Hazelcast, Inc.. All Rights Reserved.