Quantcast
Channel: BlogoSfera » need
Viewing all articles
Browse latest Browse all 40

Do class fields within an LMAX Disruptor event need to be volatile?

$
0
0

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.


Viewing all articles
Browse latest Browse all 40

Trending Articles