How does LMAX’s disruptor pattern work?

I am trying to understand the disruptor pattern. I have watched the InfoQ video and tried to read their paper. I understand there is a ring buffer involved, that it is initialized as an extremely large array to take advantage of cache locality, eliminate allocation of new memory.

It sounds like there are one or more atomic integers which keep track of positions. Each ‘event’ seems to get a unique id and it’s position in the ring is found by finding its modulus with respect to the size of the ring, etc., etc.

Unfortunately, I don’t have an intuitive sense of how it works. I have done many trading applications and studied the actor model, looked at SEDA, etc.

In their presentation they mentioned that this pattern is basically how routers work; however I haven’t found any good descriptions of how routers work either.

Are there some good pointers to a better explanation?

5 Answers
5

Leave a Comment