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
|Modifier and Type||Method and Description|
Creates a new BackoffIdleStrategy.
Perform current idle strategy's step n.
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.
public static BackoffIdleStrategy createBackoffIdleStrategy(String config)
Copyright © 2018 Hazelcast, Inc.. All Rights Reserved.