Sample code from the LMAX Disruptor “Getting Started”… public class LongEvent { private long value; public void set(long value) { this.value = value; } } Ref: https://github.com/LMAX-Exchange/disruptor/wiki/Getting-Started Why isn’t private long value declared as volatile? I ask because, implicit to the Disruptor pattern, data is shared between threads (producer -> consumer). My guess: There is […]
The post Do class fields within an LMAX Disruptor event need to be volatile? appeared first on BlogoSfera.