Class CounterResolver.AtomicBigInteger

  • Enclosing class:
    CounterResolver

    private static final class CounterResolver.AtomicBigInteger
    extends java.lang.Object
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private java.util.concurrent.atomic.AtomicReference<java.math.BigInteger> lastNumber  
    • Constructor Summary

      Constructors 
      Modifier Constructor Description
      private AtomicBigInteger​(java.math.BigInteger start)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      private boolean compareAndSetWithBackOff​(java.math.BigInteger prevNumber, java.math.BigInteger nextNumber)
      AtomicReference.compareAndSet(Object, Object) shortcut with a constant back off.
      private java.math.BigInteger getAndIncrement()  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • lastNumber

        private final java.util.concurrent.atomic.AtomicReference<java.math.BigInteger> lastNumber
    • Constructor Detail

      • AtomicBigInteger

        private AtomicBigInteger​(java.math.BigInteger start)
    • Method Detail

      • getAndIncrement

        private java.math.BigInteger getAndIncrement()
      • compareAndSetWithBackOff

        private boolean compareAndSetWithBackOff​(java.math.BigInteger prevNumber,
                                                 java.math.BigInteger nextNumber)
        AtomicReference.compareAndSet(Object, Object) shortcut with a constant back off. This technique was originally described in Lightweight Contention Management for Efficient Compare-and-Swap Operations and showed great results in benchmarks.