title: How does LMAX's disruptor pattern work?
body: <p>I am trying to understand the <a href="http://code.google.com/p/disruptor/">disruptor pattern</a>. 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. </p>
  
  <p>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.</p>
  
  <p>Unfortunately, I don't have an intuitive sense of how it works. I have done many trading applications and studied the <a href="http://en.wikipedia.org/wiki/Actor_model">actor model</a>, looked at SEDA, etc.</p>
  
  <p>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.</p>
  
  <p>Are there some good pointers to a better explanation?</p>