The volatile cursor value in the ring buffer provides the necessary
memory fence. After the producer fills the entry it must call
ProducerBarrier.commit. The commit method will set the cursor value
to the same value as the sequence on the entry. Thereby making any
modifications to the entry visible to any thread that subsequently
reads the ring buffer's cursor value, which the
ConsumerBarrier.waitFor method does. So conceptually the commit
method is the write barrier and the waitFor method is the read
barrier.
Mike.