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