Right, so yes, five years ago I moved to github pages, and never bothered to redirect any of these pages there. Now I've moved on from there, and... Finally I am using my real domain, trishagee.com . My blog is now at trishagee.com/blog . See you there!
Get link
Facebook
X
Pinterest
Email
Other Apps
Video of our JAX London session
Get link
Facebook
X
Pinterest
Email
Other Apps
At JAX London Mike and I presented "Understanding the Disruptor - A Beginner's Guide to Hardcore Concurrency". This is the session we initially previewed to the London Java Community a few weeks earlier. The content is the same, but the feel of the presentation was quite different to us - the venue for the LJC event was more intimate, and it was easier to interact with the audience. At JAX, we were up on stage, which was pretty cool actually, but meant that it felt more like a lecture and it was less easy to connect with the audience.
We received some really great feedback on this presentation, and it was brilliant to see a lot of the speakers from JAX there watching us.
I have a question regarding the slide appearing @ 22:04. Business logic has to wait for Journaling and Replication before proessing a request from the ring buffer. Are you using some kind of synchronization (i.e. volatile flags or locks)? I would expect to see an additional ring buffer between {replication, journaling} and business logic.
You can create a SequenceBarrier to define dependencies between the event handlers. See http://mechanitis.blogspot.com/2011/07/dissecting-disruptor-wiring-up.html - the names of the objects have changed slightly since I wrote that, but it gives you a feel for the mechanism.
I have a producer and multiple consumers (arrayblockingqueue based). The producer based on known conditions puts the message to the appropriate consumer's queue. so a single message is always sent to only one consumer here.
Given this, to model it with disruptor framework, is creating seperate ring buffers per consumer the only option? the producer choosing the appropriate target ring buffer for that message.
It's work pointing out that there's a Google group for the disruptor (http://groups.google.com/group/lmax-disruptor) which has some brilliant people constantly watching it - that's the best place for these sorts of queries, plus many questions have already been answered there.
There are a number of options for your specific example. In all of them it's probably best to use a single ring buffer. A simple solution is to have the producer set a flag on the event to show what type it is and then place it on the ring buffer. Each consumer will then only process those with the flag that is appropriate for them.
The newest version of the Disruptor has a number of different types of consumers, and some of those might also be appropriate.
Hi Lee, it's been a while since I worked on this stuff, but it's a good question. The best place to get more information on things like this is the Mechanical Sympathy mailing list: https://groups.google.com/forum/#!forum/mechanical-sympathy
Recently we open sourced the LMAX Disruptor , the key to what makes our exchange so fast. Why did we open source it? Well, we've realised that conventional wisdom around high performance programming is... a bit wrong. We've come up with a better, faster way to share data between threads, and it would be selfish not to share it with the world. Plus it makes us look dead clever. On the site you can download a technical article explaining what the Disruptor is and why it's so clever and fast. I even get a writing credit on it, which is gratifying when all I really did is insert commas and re-phrase sentences I didn't understand. However I find the whole thing a bit much to digest all at once, so I'm going to explain it in smaller pieces, as suits my NADD audience. First up - the ring buffer. Initially I was under the impression the Disruptor was just the ring buffer. But I've come to realise that while this data structure is at the hea...
This is the missing piece in the end-to-end view of the Disruptor. Brace yourselves, it's quite long. But I decided to keep it in a single blog so you could have the context in one place. The important areas are: not wrapping the ring; informing the consumers; batching for producers; and how multiple producers work. ProducerBarriers The Disruptor code has interfaces and helper classes for the Consumer s, but there's no interface for your producer, the thing that writes to the ring buffer. That's because nothing else needs to access your producer, only you need to know about it. However, like the consuming side, a ProducerBarrier is created by the ring buffer and your producer will use this to write to it. Writing to the ring buffer involves a two-phase commit. First, your producer has to claim the next slot on the buffer. Then, when the producer has finished writing to the slot, it will call commit on the ProducerBarrier . So let's look at...
The next in the series of understanding the Disruptor pattern developed at LMAX . After the last post we all understand ring buffers and how awesome they are. Unfortunately for you, I have not said anything about how to actually populate them or read from them when you're using the Disruptor. ConsumerBarriers and Consumers I'm going to approach this slightly backwards, because it's probably easier to understand in the long run. Assuming that some magic has populated it: how do you read something from the ring buffer? (OK, I'm starting to regret using Paint/ Gimp . Although it's an excellent excuse to purchase a graphics tablet if I do continue down this road. Also UML gurus are probably cursing my name right now.) Your Consumer is the thread that wants to get something off the buffer. It has access to a ConsumerBarrier , which is created by the RingBuffer and interacts with it on behalf of the Consumer . While the ring buffer obviously n...
Thank you for uploading this presentation!
ReplyDeleteI have a question regarding the slide appearing @ 22:04. Business logic has to wait for Journaling and Replication before proessing a request from the ring buffer. Are you using some kind of synchronization (i.e. volatile flags or locks)? I would expect to see an additional ring buffer between {replication, journaling} and business logic.
You can create a SequenceBarrier to define dependencies between the event handlers. See http://mechanitis.blogspot.com/2011/07/dissecting-disruptor-wiring-up.html - the names of the objects have changed slightly since I wrote that, but it gives you a feel for the mechanism.
ReplyDeletehi,
ReplyDeleteI have a producer and multiple consumers (arrayblockingqueue based). The producer based on known conditions puts the message to the appropriate consumer's queue. so a single message is always sent to only one consumer here.
Given this, to model it with disruptor framework, is creating seperate ring buffers per consumer the only option? the producer choosing the appropriate target ring buffer for that message.
Hi Rahul,
ReplyDeleteIt's work pointing out that there's a Google group for the disruptor (http://groups.google.com/group/lmax-disruptor) which has some brilliant people constantly watching it - that's the best place for these sorts of queries, plus many questions have already been answered there.
There are a number of options for your specific example. In all of them it's probably best to use a single ring buffer. A simple solution is to have the producer set a flag on the event to show what type it is and then place it on the ring buffer. Each consumer will then only process those with the flag that is appropriate for them.
The newest version of the Disruptor has a number of different types of consumers, and some of those might also be appropriate.
This comment has been removed by the author.
ReplyDeleteHi Lee, it's been a while since I worked on this stuff, but it's a good question. The best place to get more information on things like this is the Mechanical Sympathy mailing list: https://groups.google.com/forum/#!forum/mechanical-sympathy
Delete