Class BusySpinIdleStrategy

  • All Implemented Interfaces:
    IdleStrategy

    public class BusySpinIdleStrategy
    extends java.lang.Object
    implements IdleStrategy
    Aggressively burns CPU cycles. Use only if you need to get lowest possible latency and can afford dedicated CPU core for each thread that uses this strategy.

    Try using YieldingIdleStrategy before trying BusySpinIdleStrategy.

    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void idle()
      Idle action (sleep, wait, etc).
      void idle​(int workCount)  
      void reset()
      Reset the internal state (after doing some work).
      • Methods inherited from class java.lang.Object

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

      • BusySpinIdleStrategy

        public BusySpinIdleStrategy()
    • Method Detail

      • idle

        public void idle​(int workCount)
        Specified by:
        idle in interface IdleStrategy
        Parameters:
        workCount - amount of work done in the last cycle. Value "0" means that no work as done and some data form an external source expected.
      • idle

        public void idle()
        Description copied from interface: IdleStrategy
        Idle action (sleep, wait, etc).
        Specified by:
        idle in interface IdleStrategy
      • reset

        public void reset()
        Description copied from interface: IdleStrategy
        Reset the internal state (after doing some work).
        Specified by:
        reset in interface IdleStrategy