The Business Logic Processor is surrounded by Disruptors - a concurrency component that implements a network of queues that operate without needing locks. During the design process the team concluded that recent directions in high-performance concurrency models using queues are fundamentally at odds with modern CPU design.
The key thing about the Disruptor is that it was designed to have zero contention within the framework. This is achieved by following the single-writer principle—only one thing can ever write to a single piece of data.

Here in the London Java Community there's a lot of interest in the LMAX Disruptor framework.
When I finally get time, I'm hoping to investigate building an FBP framework based on Disruptors.
�The Business Logic Processor is surrounded by Disruptors - a concurrency component that implements a network of queues that operate without needing locks. During the design process the team concluded that recent directions in high-performance concurrency models using queues are fundamentally at odds with modern CPU design.
The team that developed the Disruptor looked at the Latency of a queue base architecture and found that the biggest bottleneck were the queues themselves, due to contention on the head. �Instead of a queue a ring buffer is used. �
The key thing about the�Disruptor is that it was designed�to have zero contention within�the framework. This is achieved�by following the single-writer�principle�only one thing can�ever write to a single piece of �data.
The full details are here:�http://code.google.com/p/disruptor/
Here's an explanation about how the diamond pattern of consumers is wired up using a DSL:�http://mechanitis.blogspot.co.uk/2011/07/dissecting-disruptor-wiring-up.html
Here is the traditional queue based approach:Here is the Disruptor:
The single ring buffer is passed between the processors rather than the items being passed from queue to queue, removing the needs to read and write from the�intermediate�queues.
In factory analogy this is the equivalent of moving from series production to a one piece flow:�http://www.thetoyotasystem.com/lean_concepts/one_piece_flow.php��
![]()
Instead of having buffers of inventory between each work station there is a continuous flow.
I'd love to hear peoples thoughts.
Hi Ged,
The diagram in "Dissecting Disruptor Wiring" looks incredibly complicated! I hope I don't come across as someone who is wedded to an old technology - but maybe you can explain what the appeal of this approach is!
A couple of specific points - maybe you can clarify...
- I am wondering if they assume queues have to be filled up and then emptied completely...? Just in case they think that, I should point out that FBP connections _are_ ring structures, where a get pointer chases a put pointer around the ring. I am not sure if that is made clear in my book - I didn't realize it might be important :-) A process is only suspended when it tries to send to a full connection, or receive from an empty one. FBP implementations have always used ring structures - as you know, this goes back to the late '60s.
- The kanbans described in the "one piece flow" article sound to me like FBP connections with capacity of 1, although the Wikipedia article seems to suggest a more flexible set up - again I may be wrong.
- Again, as I keep saying, the "diamond" pattern IMO is deadlock-prone, and the article seems to jump through hoops to support this - I much prefer the simple solution I described in Wikipedia Merge Proposal or, when you have huge amounts of data, Mike Beckerle's approach - see http://groups.google.com/group/flow-based-programming/browse_thread/thread/1904d6a109f69fcc
It seems as if they satisfy the diamond by having really complicated scheduling rules - I am not sure if it scales up...
- How can you have a network of queues without needing locks? As soon as you have more than one thread accessing anything, I was under the impression you needed locks. In JavaFBP and C#FBP we basically only need locks on connections (and one other more complex situation); in AMPS we didn't need locks, but then we only had one processor, therefore one thread.
- I guess I don't understand the "only one thing can ever write to a single piece of data" principle - I assume this is different from FBP's ownership rules...?
Regards, and apologies if these are dumb questions!
Paul
PS I assume this Martin Fowler is the UML guy...? Sounds like he is interested in a lot of the same things that we are! What does he think of FBP?!
PPS Kilim is very fast, and that's quite FBP-like...
On 13/04/2012 5:25 AM, Ged Byrne wrote:
Here in the London Java Community there's a lot of interest in the LMAX Disruptor framework.
When I finally get time, I'm hoping to investigate building an FBP framework based on Disruptors.
The Business Logic Processor is surrounded by Disruptors - a concurrency component that implements a network of queues that operate without needing locks. During the design process the team concluded that recent directions in high-performance concurrency models using queues are fundamentally at odds with modern CPU design.
The team that developed the Disruptor looked at the Latency of a queue base architecture and found that the biggest bottleneck were the queues themselves, due to contention on the head. Instead of a queue a ring buffer is used.
The key thing about the Disruptor is that it was designed to have zero contention within the framework. This is achieved by following the single-writer principle—only one thing can ever write to a single piece of data.
The full details are here: http://code.google.com/p/disruptor/
Here's an explanation about how the diamond pattern of consumers is wired up using a DSL: http://mechanitis.blogspot.co.uk/2011/07/dissecting-disruptor-wiring-up.html
Here is the traditional queue based approach:Here is the Disruptor:
The single ring buffer is passed between the processors rather than the items being passed from queue to queue, removing the needs to read and write from the intermediate queues.
In factory analogy this is the equivalent of moving from series production to a one piece flow: http://www.thetoyotasystem.com/lean_concepts/one_piece_flow.php
![]()
Instead of having buffers of inventory between each work station there is a continuous flow.
I'd love to hear peoples thoughts.
Regards,
Hi Paul,
Good questions. �I believe that the�"only one thing can ever write to a single piece of data" principle is actually closely related to FBP's ownership rules. �That's what I'm hoping to explore.
Don't get too tied up to the kanban analogy, I was just using that to tie it back to the running factory metaphor.
Regards,�
Ged
On 13 April 2012 15:57, Paul Morrison <paul.m...@rogers.com> wrote:
Hi Ged,
The diagram in "Dissecting Disruptor Wiring" looks incredibly complicated!� I hope I don't come across as someone who is wedded to an old technology - but maybe you can explain what the appeal of this approach is!
A couple of specific points - maybe you can clarify...
- I am wondering if they assume queues have to be filled up and then emptied completely...?� Just in case they think that, I should point out that FBP connections _are_ ring structures, where a get pointer chases a put pointer around the ring.� I am not sure if that is made clear in my book - I didn't realize it might be important :-)�� A process is only suspended when it tries to send to a full connection,� or receive from an empty one.�� FBP implementations have always used ring structures - as you know, this goes back to the late '60s.
- The kanbans described in the "one piece flow" article sound to me like FBP connections with capacity of 1, although the Wikipedia article seems to suggest a more flexible set up - again I may be wrong.
- Again, as I keep saying, the "diamond" pattern IMO is deadlock-prone, and the article seems to jump through hoops to support this - I much prefer the simple solution I described in Wikipedia Merge Proposal or, when you have huge amounts of data, Mike Beckerle's approach - see http://groups.google.com/group/flow-based-programming/browse_thread/thread/1904d6a109f69fcc
It seems as if they satisfy the diamond by having really complicated scheduling rules - I am not sure if it scales up...
- How can you have a network of queues without needing locks?� As soon as you have more than one thread accessing anything, I was under the impression you needed locks.� In JavaFBP and C#FBP we basically only need locks on connections (and one other more complex situation); in AMPS we didn't need locks, but then we only had one processor, therefore one thread.
- I guess I don't understand the "only one thing can ever write to a single piece of data" principle - I assume this is different from FBP's ownership rules...?�
Regards, and apologies if these are dumb questions!
Paul
PS I assume this Martin Fowler is the UML guy...?� Sounds like he is interested in a lot of the same things that we are!� What does he think of FBP?!
PPS Kilim is very fast, and that's quite FBP-like...
On 13/04/2012 5:25 AM, Ged Byrne wrote:
Here in the London Java Community there's a lot of interest in the LMAX Disruptor framework.
When I finally get time, I'm hoping to investigate building an FBP framework based on Disruptors.
�The Business Logic Processor is surrounded by Disruptors - a concurrency component that implements a network of queues that operate without needing locks. During the design process the team concluded that recent directions in high-performance concurrency models using queues are fundamentally at odds with modern CPU design.
The team that developed the Disruptor looked at the Latency of a queue base architecture and found that the biggest bottleneck were the queues themselves, due to contention on the head. �Instead of a queue a ring buffer is used. �
The key thing about the�Disruptor is that it was designed�to have zero contention within�the framework. This is achieved�by following the single-writer�principle�only one thing can�ever write to a single piece of �data.
The full details are here:�http://code.google.com/p/disruptor/
Here's an explanation about how the diamond pattern of consumers is wired up using a DSL:�http://mechanitis.blogspot.co.uk/2011/07/dissecting-disruptor-wiring-up.html
Here is the traditional queue based approach:Here is the Disruptor:
The single ring buffer is passed between the processors rather than the items being passed from queue to queue, removing the needs to read and write from the�intermediate�queues.
In factory analogy this is the equivalent of moving from series production to a one piece flow:�http://www.thetoyotasystem.com/lean_concepts/one_piece_flow.php��
![]()
Instead of having buffers of inventory between each work station there is a continuous flow.
I'd love to hear peoples thoughts.
> John (Cowan), as you have helped me in the past with locking (for
> which thanks), does the above make sense?
As you described it, yes. There is no need to lock the whole buffer, only
when there is contention in part of it.
--
John Cowan co...@ccil.org
At times of peril or dubitation, http://www.ccil.org/~cowan
Perform swift circular ambulation,
With loud and high-pitched ululation.
In the Toyota system Dorothy makes the Stephen's job entirely. It's just a matter of working (time) balance here that is not related to either system. A person is just doing more work so another one could be released.
Is the name: "Mass Production System" contrary to the "Toyota System"? I think that Toyota System is a set of improvements complementary to the "Mass Production System" and nothing more than the article tries to induce. Is not "Toyota System" a "Mass Production System"?
1. a) Mass production demands mass consumption. b) Flow production requires continuity of demand.
//burst size of 1000//16 parallel runs of 200000000 messages each.//3200000000 messages sent with 4 threads.//msgs per sec = 1,005,340,873 (now 185,485,740)//.99 nanoseconds per message//5 clock cycles per message
//burst size of 1000//16 parallel runs of 20000000 messages each.//320000000 messages sent with 4 threads.//msgs per sec = 108511359//9.2 nanoseconds per message//46 clock cycles per message
//burst size of 1000//4 parallel runs of 100000000 messages each.//400000000 messages sent with 4 threads.//msgs per sec = 43080236//23 nanoseconds per message//116 clock cycles per message
Paul,I do not see how these exercises would be helpful.
[...]
A DFD network definition might look something like this:
%NP = 81;
PROCESS S supervisor $(%NP);
Here in the London Java Community there's a lot of interest in the LMAX Disruptor framework.When I finally get time, I'm hoping to investigate building an FBP framework based on Disruptors.The Business Logic Processor is surrounded by Disruptors - a concurrency component that implements a network of queues that operate without needing locks. During the design process the team concluded that recent directions in high-performance concurrency models using queues are fundamentally at odds with modern CPU design.The team that developed the Disruptor looked at the Latency of a queue base architecture and found that the biggest bottleneck were the queues themselves, due to contention on the head. Instead of a queue a ring buffer is used.The key thing about the Disruptor is that it was designed to have zero contention within the framework. This is achieved by following the single-writer principle—only one thing can ever write to a single piece of data.The full details are here: http://code.google.com/p/disruptor/Here's an explanation about how the diamond pattern of consumers is wired up using a DSL: http://mechanitis.blogspot.co.uk/2011/07/dissecting-disruptor-wiring-up.html
Here is the traditional queue based approach:
Here is the Disruptor:
The single ring buffer is passed between the processors rather than the items being passed from queue to queue, removing the needs to read and write from the intermediate queues.In factory analogy this is the equivalent of moving from series production to a one piece flow: http://www.thetoyotasystem.com/lean_concepts/one_piece_flow.php
Instead of having buffers of inventory between each work station there is a continuous flow.I'd love to hear peoples thoughts.Regards,Ged
Here in the London Java Community there's a lot of interest in the LMAX Disruptor framework.When I finally get time, I'm hoping to investigate building an FBP framework based on Disruptors.The Business Logic Processor is surrounded by Disruptors - a concurrency component that implements a network of queues that operate without needing locks. During the design process the team concluded that recent directions in high-performance concurrency models using queues are fundamentally at odds with modern CPU design.The team that developed the Disruptor looked at the Latency of a queue base architecture and found that the biggest bottleneck were the queues themselves, due to contention on the head. Instead of a queue a ring buffer is used.The key thing about the Disruptor is that it was designed to have zero contention within the framework. This is achieved by following the single-writer principle—only one thing can ever write to a single piece of data.The full details are here: http://code.google.com/p/disruptor/Here's an explanation about how the diamond pattern of consumers is wired up using a DSL: http://mechanitis.blogspot.co.uk/2011/07/dissecting-disruptor-wiring-up.html
Here is the traditional queue based approach:
Here is the Disruptor:
The single ring buffer is passed between the processors rather than the items being passed from queue to queue, removing the needs to read and write from the intermediate queues.In factory analogy this is the equivalent of moving from series production to a one piece flow: http://www.thetoyotasystem.com/lean_concepts/one_piece_flow.php
Instead of having buffers of inventory between each work station there is a continuous flow.I'd love to hear peoples thoughts.Regards,Ged
Here in the London Java Community there's a lot of interest in the LMAX Disruptor framework.