@Override
    public boolean offer(final E e) {
        if (null == e) {
            throw new NullPointerException();
        }
        final long mask = this.mask;
        final long capacity = mask + 1;
        final long[] sBuffer = sequenceBuffer;
        long pIndex;
        long seqOffset;
        long seq;
        // start with bogus value, hope we don't need it
        long cIndex = Long.MIN_VALUE;
        do {
            pIndex = lvProducerIndex();
            seqOffset = calcCircularLongElementOffset(pIndex, mask);
            seq = lvLongElement(sBuffer, seqOffset);
            // consumer has not moved this seq forward, it's as last producer left
            if (seq < pIndex) {
                // Extra check required to ensure [Queue.offer == false iff queue is full]
                if (// test against cached cIndex
                pIndex - capacity >= cIndex && // test against latest cIndex
                pIndex - capacity >= (cIndex = lvConsumerIndex())) {
                    return false;
                } else {
                    // (+) hack to make it go around again without CAS
                    seq = pIndex + 1;
                }
            }
        } while (// another producer has moved the sequence(or +)
        seq > pIndex || // failed to increment
        !casProducerIndex(pIndex, pIndex + 1));
        // casProducerIndex ensures correct construction
        spRefElement(buffer, calcCircularRefElementOffset(pIndex, mask), e);
        // seq++;
        soLongElement(sBuffer, seqOffset, pIndex + 1);
        return true;
    }
NOTE: This class was automatically generated by org.jctools.queues.unpadded.JavaParsingUnpaddedQueueGenerator
which can found in the jctools-build module. The original source file is MpmcArrayQueue.java.

A Multi-Producer-Multi-Consumer queue based on a {@link org.jctools.queues.ConcurrentCircularArrayQueue}. This
implies that any and all threads may call the offer/poll/peek methods and correctness is maintained. <br>
This implementation follows patterns documented on the package level for False Sharing protection.<br>
The algorithm for offer/poll is an adaptation of the one put forward by D. Vyukov (See <a
href="http://www.1024cores.net/home/lock-free-algorithms/queues/bounded-mpmc-queue">here</a>). The original
algorithm uses an array of structs which should offer nice locality properties but is sadly not possible in
Java (waiting on Value Types or similar). The alternative explored here utilizes 2 arrays, one for each
field of the struct. There is a further alternative in the experimental project which uses iteration phase
markers to achieve the same algo and is closer structurally to the original, but sadly does not perform as
well as this implementation.<br>
<p>
Tradeoffs to keep in mind:
<ol>
<li>Padding for false sharing: counter fields and queue fields are all padded as well as either side of
both arrays. We are trading memory to avoid false sharing(active and passive).
<li>2 arrays instead of one: The algorithm requires an extra array of longs matching the size of the
elements array. This is doubling/tripling the memory allocated for the buffer.
<li>Power of 2 capacity: Actual elements buffer (and sequence buffer) is the closest power of 2 larger or
equal to the requested capacity.
</ol>
jctools-core/src/main/java/org/jctools/queues/unpadded/MpmcUnpaddedArrayQueue.java