SlideShare a Scribd company logo
Concurrent Programming
                          Using The Disruptor
                            Trisha Gee, Developer at LMAX
                                       @trisha_gee
                                   mechanitis.blogspot.com




Tuesday, 9 October 12
The Disruptor?




Tuesday, 9 October 12
What is it?

                  • Data structure and work flow with no
                        contention.
                  • Very fast message passing.
                  • Allows you to go truly parallel.


Tuesday, 9 October 12
The Magic RingBuffer




Tuesday, 9 October 12
The Magic RingBuffer




Tuesday, 9 October 12
The Magic RingBuffer




Tuesday, 9 October 12
The Magic RingBuffer




Tuesday, 9 October 12
The Magic RingBuffer




Tuesday, 9 October 12
The Magic RingBuffer




Tuesday, 9 October 12
The Magic RingBuffer




Tuesday, 9 October 12
The Events are Buckets




Tuesday, 9 October 12
I’ve got a RingBuffer!


                    • Erm.... how do I poke things into it?



Tuesday, 9 October 12
The Publisher




Tuesday, 9 October 12
Tuesday, 9 October 12
Tuesday, 9 October 12
Tuesday, 9 October 12
Tuesday, 9 October 12
Tuesday, 9 October 12
Tuesday, 9 October 12
...so now I want to read


                    • The Disruptor provides nice batching
                        behaviour for free




Tuesday, 9 October 12
BatchEventProcessor




Tuesday, 9 October 12
Tuesday, 9 October 12
Tuesday, 9 October 12
Tuesday, 9 October 12
Tuesday, 9 October 12
Tuesday, 9 October 12
Tuesday, 9 October 12
Tuesday, 9 October 12
Tuesday, 9 October 12
Tuesday, 9 October 12
Tuesday, 9 October 12
Tuesday, 9 October 12
Tuesday, 9 October 12
Tuesday, 9 October 12
Tuesday, 9 October 12
Shiny. So what?



Tuesday, 9 October 12
Complex Workflows




Tuesday, 9 October 12
...and in the Disruptor?




Tuesday, 9 October 12
Let’s go parallel




Tuesday, 9 October 12
Caveats

                    • Your ring buffer needs to be bigger than 12
                    • Event handlers are on separate threads
                    • Mileage May Vary - always performance test


Tuesday, 9 October 12
You get...
                    • A framework the encourages you to model
                        your domain
                    • The ability to run in parallel but single-
                        threaded
                    • Nice, simple Java
                    • Reliable ordering
                    • ...and it can be very fast
Tuesday, 9 October 12
Is that it?

                    • Wait strategies
                    • Batch publishing
                    • Multiple publishers
                    • The Wizard
                    • You don’t even need a RingBuffer...

Tuesday, 9 October 12
More Information

                    • Github:
                        github.com/LMAX-Exchange/disruptor
                    • Google Group
                    • Blogs


Tuesday, 9 October 12
Q&A



Tuesday, 9 October 12
WorkerPool




Tuesday, 9 October 12
AggregateEventHandler




Tuesday, 9 October 12
WaitStrategies

                    • BlockingWaitStrategy
                    • BusySpinWaitStrategy
                    • SleepingWaitStrategy
                    • YieldingWaitStrategy

Tuesday, 9 October 12
ClaimStrategies

                    • SingleThreadedClaimStrategy
                    • MultiThreadedClaimStrategy
                    • MultiThreadedLowContentionClaimStrategy


Tuesday, 9 October 12

More Related Content

What's hot (20)

PDF
LMAX Architecture
Stephan Schmidt
 
PPTX
Docker Security workshop slides
Docker, Inc.
 
PPTX
Introduction to Kafka Cruise Control
Jiangjie Qin
 
PPSX
LMAX Disruptor as real-life example
Guy Nir
 
PPSX
LMAX Disruptor - High Performance Inter-Thread Messaging Library
Sebastian Andrasoni
 
PPTX
HBase and HDFS: Understanding FileSystem Usage in HBase
enissoz
 
PPTX
Flink Streaming
Gyula Fóra
 
PPTX
Disruptor
Larry Nung
 
PDF
A Deep Dive into Kafka Controller
confluent
 
PDF
Quarkus - a next-generation Kubernetes Native Java framework
SVDevOps
 
PDF
Quarkus tips, tricks, and techniques
Red Hat Developers
 
PDF
Windows IOCP vs Linux EPOLL Performance Comparison
Seungmo Koo
 
KEY
Concurrent Programming Using the Disruptor
Trisha Gee
 
PDF
Docker Introduction
Peng Xiao
 
PDF
[오픈소스컨설팅] Open Stack Ceph, Neutron, HA, Multi-Region
Ji-Woong Choi
 
PDF
Automated master failover
Yoshinori Matsunobu
 
PPTX
Kafka 101
Clement Demonchy
 
PDF
Real time stock processing with apache nifi, apache flink and apache kafka
Timothy Spann
 
PPTX
Ceph Introduction 2017
Karan Singh
 
PDF
Infrastructure as Code with Terraform and Ansible
DevOps Meetup Bern
 
LMAX Architecture
Stephan Schmidt
 
Docker Security workshop slides
Docker, Inc.
 
Introduction to Kafka Cruise Control
Jiangjie Qin
 
LMAX Disruptor as real-life example
Guy Nir
 
LMAX Disruptor - High Performance Inter-Thread Messaging Library
Sebastian Andrasoni
 
HBase and HDFS: Understanding FileSystem Usage in HBase
enissoz
 
Flink Streaming
Gyula Fóra
 
Disruptor
Larry Nung
 
A Deep Dive into Kafka Controller
confluent
 
Quarkus - a next-generation Kubernetes Native Java framework
SVDevOps
 
Quarkus tips, tricks, and techniques
Red Hat Developers
 
Windows IOCP vs Linux EPOLL Performance Comparison
Seungmo Koo
 
Concurrent Programming Using the Disruptor
Trisha Gee
 
Docker Introduction
Peng Xiao
 
[오픈소스컨설팅] Open Stack Ceph, Neutron, HA, Multi-Region
Ji-Woong Choi
 
Automated master failover
Yoshinori Matsunobu
 
Kafka 101
Clement Demonchy
 
Real time stock processing with apache nifi, apache flink and apache kafka
Timothy Spann
 
Ceph Introduction 2017
Karan Singh
 
Infrastructure as Code with Terraform and Ansible
DevOps Meetup Bern
 

Similar to Introduction to the Disruptor (20)

PDF
Concurrent Programming Using The Disruptor - Copenhagen
Trisha Gee
 
PDF
Workshop: Introduction to the Disruptor
Trisha Gee
 
PDF
Play concurrency
Justin Long
 
PDF
Reactive applications using Akka
Miguel Pastor
 
PDF
Erlang for video delivery
Hugh Watkins
 
PPTX
VTU 6th Sem Elective CSE - Module 3 cloud computing
Sachin Gowda
 
PDF
Akka scalaliftoff london_2010
Skills Matter
 
PDF
Introduction to concurrent programming with akka actors
datamantra
 
PDF
Introduction to concurrent programming with Akka actors
Shashank L
 
PDF
Java performance: What's the big deal? - Trisha Gee
JAX London
 
PPTX
Indic threads pune12-typesafe stack software development on the jvm
IndicThreads
 
PDF
REST & Hypermedia: the missing links and why you need them - Ruby Hoedown 2012
Phil Harvey
 
PDF
soft-shake.ch - Data grids and Data Caching
soft-shake.ch
 
PDF
Scala profiling
Filippo Pacifici
 
PPT
Parallel Programming Primer 1
mobius.cn
 
PDF
Project FoX: A Tool That Offers Automated Testing Using a Formal Approach
Ivo Neskovic
 
PDF
Software Engineering In PHP
Ralph Schindler
 
PDF
Take a Look at Akka+Java (English version)
GlobalLogic Ukraine
 
PDF
Building Reactive Applications with Akka & Java 8 - Bonèr
Codemotion
 
PDF
Orientation - Java
Franco Nazareno
 
Concurrent Programming Using The Disruptor - Copenhagen
Trisha Gee
 
Workshop: Introduction to the Disruptor
Trisha Gee
 
Play concurrency
Justin Long
 
Reactive applications using Akka
Miguel Pastor
 
Erlang for video delivery
Hugh Watkins
 
VTU 6th Sem Elective CSE - Module 3 cloud computing
Sachin Gowda
 
Akka scalaliftoff london_2010
Skills Matter
 
Introduction to concurrent programming with akka actors
datamantra
 
Introduction to concurrent programming with Akka actors
Shashank L
 
Java performance: What's the big deal? - Trisha Gee
JAX London
 
Indic threads pune12-typesafe stack software development on the jvm
IndicThreads
 
REST & Hypermedia: the missing links and why you need them - Ruby Hoedown 2012
Phil Harvey
 
soft-shake.ch - Data grids and Data Caching
soft-shake.ch
 
Scala profiling
Filippo Pacifici
 
Parallel Programming Primer 1
mobius.cn
 
Project FoX: A Tool That Offers Automated Testing Using a Formal Approach
Ivo Neskovic
 
Software Engineering In PHP
Ralph Schindler
 
Take a Look at Akka+Java (English version)
GlobalLogic Ukraine
 
Building Reactive Applications with Akka & Java 8 - Bonèr
Codemotion
 
Orientation - Java
Franco Nazareno
 
Ad

More from Trisha Gee (20)

PPTX
Career Advice for Architects
Trisha Gee
 
PPTX
Is boilerplate code really so bad?
Trisha Gee
 
PPTX
Code Review Best Practices
Trisha Gee
 
PDF
Career Advice for Programmers - ProgNET London
Trisha Gee
 
PDF
Is Boilerplate Code Really So Bad?
Trisha Gee
 
PPTX
Real World Java 9 - JetBrains Webinar
Trisha Gee
 
PDF
Real World Java 9
Trisha Gee
 
PPTX
Real World Java 9
Trisha Gee
 
PPTX
Career Advice for Programmers
Trisha Gee
 
PPTX
Real World Java 9
Trisha Gee
 
PPTX
Becoming fully buzzword compliant
Trisha Gee
 
PDF
Real World Java 9 (QCon London)
Trisha Gee
 
PPTX
Java 9 Functionality and Tooling
Trisha Gee
 
PDF
Java 8 and 9 in Anger
Trisha Gee
 
PDF
Refactoring to Java 8 (Devoxx BE)
Trisha Gee
 
PDF
Code Review Matters and Manners
Trisha Gee
 
PDF
Refactoring to Java 8 (QCon New York)
Trisha Gee
 
PDF
Refactoring to Java 8 (Devoxx UK)
Trisha Gee
 
PDF
Staying Ahead of the Curve
Trisha Gee
 
PPTX
Level Up Your Automated Tests
Trisha Gee
 
Career Advice for Architects
Trisha Gee
 
Is boilerplate code really so bad?
Trisha Gee
 
Code Review Best Practices
Trisha Gee
 
Career Advice for Programmers - ProgNET London
Trisha Gee
 
Is Boilerplate Code Really So Bad?
Trisha Gee
 
Real World Java 9 - JetBrains Webinar
Trisha Gee
 
Real World Java 9
Trisha Gee
 
Real World Java 9
Trisha Gee
 
Career Advice for Programmers
Trisha Gee
 
Real World Java 9
Trisha Gee
 
Becoming fully buzzword compliant
Trisha Gee
 
Real World Java 9 (QCon London)
Trisha Gee
 
Java 9 Functionality and Tooling
Trisha Gee
 
Java 8 and 9 in Anger
Trisha Gee
 
Refactoring to Java 8 (Devoxx BE)
Trisha Gee
 
Code Review Matters and Manners
Trisha Gee
 
Refactoring to Java 8 (QCon New York)
Trisha Gee
 
Refactoring to Java 8 (Devoxx UK)
Trisha Gee
 
Staying Ahead of the Curve
Trisha Gee
 
Level Up Your Automated Tests
Trisha Gee
 
Ad

Introduction to the Disruptor