public MultiProducerSequencer(int bufferSize, IWaitStrategy waitStrategy) : base(bufferSize, waitStrategy) { _availableBuffer = new int[bufferSize]; _indexMask = bufferSize - 1; _indexShift = Util.Log2(bufferSize); InitialiseAvailableBuffer(); }
public MultiProducerSequencer(int bufferSize, IWaitStrategy waitStrategy) : base(bufferSize, waitStrategy) { indexMask = bufferSize - 1; indexShift = Util.Log2(bufferSize); pendingPublication = new _Volatile.IntegerArray(bufferSize); _pendingMask = bufferSize - 1; InitialiseAvailableBuffer(); }
public MultiProducerSequencer(int bufferSize, IWaitStrategy waitStrategy) { if (bufferSize < 1) { throw new ArgumentException("bufferSize must not be less than 1"); } if (!bufferSize.IsPowerOf2()) { throw new ArgumentException("bufferSize must be a power of 2"); } _bufferSize = bufferSize; _waitStrategy = waitStrategy; _isBlockingWaitStrategy = !(waitStrategy is INonBlockingWaitStrategy); _availableBuffer = new int[bufferSize]; _indexMask = bufferSize - 1; _indexShift = Util.Log2(bufferSize); InitialiseAvailableBuffer(); }