com.lmax.disruptor
Class MultiThreadedLowContentionClaimStrategy

java.lang.Object
  extended by com.lmax.disruptor.AbstractMultithreadedClaimStrategy
      extended by com.lmax.disruptor.MultiThreadedLowContentionClaimStrategy
All Implemented Interfaces:
ClaimStrategy

public final class MultiThreadedLowContentionClaimStrategy
extends AbstractMultithreadedClaimStrategy

Strategy to be used when there are multiple publisher threads claiming sequences. This strategy requires sufficient cores to allow multiple publishers to be concurrently claiming sequences and those thread a contented relatively infrequently.


Constructor Summary
MultiThreadedLowContentionClaimStrategy(int bufferSize)
          Construct a new multi-threaded publisher ClaimStrategy for a given buffer size.
 
Method Summary
 void serialisePublishing(long sequence, Sequence cursor, int batchSize)
          Serialise publishers in sequence and set cursor to latest available sequence.
 
Methods inherited from class com.lmax.disruptor.AbstractMultithreadedClaimStrategy
checkAndIncrement, getBufferSize, getSequence, hasAvailableCapacity, incrementAndGet, incrementAndGet, setSequence
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MultiThreadedLowContentionClaimStrategy

public MultiThreadedLowContentionClaimStrategy(int bufferSize)
Construct a new multi-threaded publisher ClaimStrategy for a given buffer size.

Parameters:
bufferSize - for the underlying data structure.
Method Detail

serialisePublishing

public void serialisePublishing(long sequence,
                                Sequence cursor,
                                int batchSize)
Description copied from interface: ClaimStrategy
Serialise publishers in sequence and set cursor to latest available sequence.

Parameters:
sequence - sequence to be applied
cursor - to serialise against.
batchSize - of the sequence.


Copyright © 2011 LMAX Ltd. All Rights Reserved.