SlideShare una empresa de Scribd logo
1 de 31
Descargar para leer sin conexión
Jitendra Chittoda, Member Development Department @ ION Trading India
Pvt. Ltd.
Co-leader Delhi and NCR Java User Group (DaNJUG)
Email: jitendra@chittoda.com
Twitter: @JChittoda
Blog: http://chittoda.com
Sequential Concurrency…. WHAT
???
08 May 20131
JavaOne India 2013 : COM1240
Delhi & NCR JUG (DaNJUG)
08 May 20132
 30+ Members
 Looking for more active members
 Meetup.com, Groups
 If your friends are in Delhi NCR, please spread
the word
Agenda
 What is ThreadPool
 Benefits of using ThreadPool
 What we can’t achieve with ThreadPool
 Why & Where ?
 Sequential Concurrency Fundamentals
 SerialExecutor
 StripedExecutorService Design
 Features
 Current State
08 May 20133
ThreadPool
08 May 20134
Benefits of ThreadPool
08 May 20135
 Pre-initialized pool of threads
 Reusable threads
 Configurable
What we can’t achieve with
ThreadPool
08 May 20136
 As per the business requirement, sometimes you
may want to process Tasks in specific order.
 Tasks execution order is not maintained by the
normal ThreadPools
 Processing Not Ordered
 Processing of a Task is not ordered, you can say its
uncertain.
08 May 20137
Why? Industry Examples
08 May 20138
 Exchange trading
 Processing of trades on an instrument.
 Train Reservations
 Ticket booking requests for a train must be
processed in FIFO order.
 Multi Tenancy
 Each tenant want some specific execution to be
ordered
Where ?
08 May 20139
 First saw in 2007 then in 2010 and in 2011
 November 2011: Started writing my own
implementation, published a blog on
http://chittoda.com
 November 2012:
 http://www.javaspecialists.eu/archive/Issue206.html
 Heinz got 5 different implementations after this
issue.
Sequential Concurrency
Fundamentals
08 May 201310
•Identification
•Maintaining Order
•Sequential Processing
•No Dependency
Sequential Concurrency
Fundamentals
08 May 201311
 Identification
• Maintain the sequence based on some Stripe or
Key
• Stripe: An object which is common among the
Tasks those needs to be processed in sequence.
Sequential Concurrency
Fundamentals
08 May 201312
 Maintaining Order
• Maintain the sequential ordering tasks
• FIFO Order
Sequential Concurrency
Fundamentals
08 May 201313
 Sequential Processing
 Process tasks of a Stripe in sequence
 To maintain this we assign one and only one Thread to a
Queue.
Sequential Concurrency
Fundamentals
08 May 201314
 No Dependency
 Tasks of one Stripe-X should not be dependent on Tasks of
another Stripe-Y
Sequential Concurrency
08 May 201315
12 132
Pool of
Threads
Queue of
Stripe
StripedExecutorServic
e
T-
1
T-
2
T-
3
Executor JavaDoc
08 May 201316
• Many Executor implementations impose some sort of
limitation on how and when tasks are scheduled. The
executor below serializes the submission of tasks to a
second executor, illustrating a composite executor.
class SerialExecutor implements Executor {
Queue<Runnable> tasks = new ArrayDeque<>();
Executor executor;
Runnable active;
SerialExecutor(Executor executor) {
this.executor = executor;
}
SerialExecutor
08 May 201317
public void execute(final Runnable r) {
tasks.offer(new Runnable() {
public void run() {
try {
r.run();
} finally {
scheduleNext();
}
}
});
if (active == null) {
scheduleNext();
}
}
SerialExecutor
08 May 201318
protected void scheduleNext() {
if ((active = tasks.poll()) != null) {
executor.execute(active);
}
}
Pool of SerialExecutor
08 May 201319
 SerialExecutor maintain the sequence of the
tasks assigned to it and process them in
sequence. Using single queue.
 BUT we need pool of SerialExecutor, so that we
can concurrently execute tasks of two or more
Striped Queues
Implementation Details
08 May 201320
1) Identification
• Stripe: We are using Object as Stripe, you can
define your own.
2) Maintain Order
• With separate Queue based on Stripe.
• SerialExecutor is maintaining a Queue
3) Sequential Processing
• Handled by SerialExecutor
4) No Dependency
• Handled by SerialExecutor
Design
08 May 201321
08 May 201322
08 May 201323
Inside StripedExecutorService
08 May 201324
class SerialExecutor implements Executor {
private BlockingQueue<Runnable> tasks =
new LinkedBlockingQueue<>();
private Runnable active;
private final Object stripe;
private SerialExecutor(Object stripe) {
this.stripe = stripe;
}
08 May 201325
public void execute(final Runnable r) {
lock.lock();
try {
tasks.add(new Runnable() {
public void run() {
try {
r.run();
} finally { scheduleNext(); }
}
});
if (active == null){ scheduleNext(); }
} finally {
lock.unlock();
}
}
Inside StripedExecutorService
08 May 201326
private void scheduleNext() {
lock.lock();
try {
if ((active = tasks.poll()) != null) {
executor.execute(active);
terminating.signalAll();
} else {
removeEmptySerialExecutor(stripe, this);
}
} finally {
lock.unlock();
}
}
08 May 201327
private final ExecutorService executor;
private final Map<Object, SerialExecutor> executors =
new IdentityHashMap<>();
public void execute(Runnable command) {
lock.lock();
try {
Object stripe = getStripe(command);
if (stripe != null) {
SerialExecutor ser_exec=
executors.get(stripe);
if (ser_exec == null) {
executors.put(stripe, ser_exec=
new SerialExecutor(stripe));
}
ser_exec.execute(command);
} else { executor.execute(command); }
} finally { lock.unlock(); }
}
Features
08 May 201328
 Non striped tasks can also be handled with SES
 Queues gets created when required
 No memory leaks in terms of the Queues. Queues
gets removed once all tasks are finished.
Current State
08 May 201329
 Work In Progress
 Several other implementations available, but no
one passes the tests written for
StripedExecutorService
 Performance
References
08 May 201330
 Delhi & NCR JUG
 https://groups.google.com/d/forum/dncrjug
 GitHub :
 https://github.com/kabutz/striped-executor-service
 Dr. Heinz Kabutz Newsletter
 http://www.javaspecialists.eu/archive/Issue206.html
 http://www.javaspecialists.eu/
 Blog
 http://chittoda.com
08 May 201331

Más contenido relacionado

Similar a Jitendra Chittoda discusses sequential concurrency and StripedExecutorService design

Similar a Jitendra Chittoda discusses sequential concurrency and StripedExecutorService design (20)

Microservices and modularity with java
Microservices and modularity with javaMicroservices and modularity with java
Microservices and modularity with java
 
important struts interview questions
important struts interview questionsimportant struts interview questions
important struts interview questions
 
MySQL Fabric: Easy Management of MySQL Servers
MySQL Fabric: Easy Management of MySQL ServersMySQL Fabric: Easy Management of MySQL Servers
MySQL Fabric: Easy Management of MySQL Servers
 
Struts 2-overview2
Struts 2-overview2Struts 2-overview2
Struts 2-overview2
 
Struts2-Spring=Hibernate
Struts2-Spring=HibernateStruts2-Spring=Hibernate
Struts2-Spring=Hibernate
 
Scalamen and OT
Scalamen and OTScalamen and OT
Scalamen and OT
 
Unit-Testing Your Legacy JavaScript
Unit-Testing Your Legacy JavaScriptUnit-Testing Your Legacy JavaScript
Unit-Testing Your Legacy JavaScript
 
Struts framework
Struts frameworkStruts framework
Struts framework
 
72185-26528-StrutsMVC
72185-26528-StrutsMVC72185-26528-StrutsMVC
72185-26528-StrutsMVC
 
Struts framework
Struts frameworkStruts framework
Struts framework
 
Extending the Mule Runtime - Building a Circuit Breaker Component.pptx
Extending the Mule Runtime - Building a Circuit Breaker Component.pptxExtending the Mule Runtime - Building a Circuit Breaker Component.pptx
Extending the Mule Runtime - Building a Circuit Breaker Component.pptx
 
Distributed tracing 101
Distributed tracing 101Distributed tracing 101
Distributed tracing 101
 
Distributed Tracing
Distributed TracingDistributed Tracing
Distributed Tracing
 
Java concurrency
Java concurrencyJava concurrency
Java concurrency
 
Jakarta Concurrency: Present and Future
Jakarta Concurrency: Present and FutureJakarta Concurrency: Present and Future
Jakarta Concurrency: Present and Future
 
Session 41 - Struts 2 Introduction
Session 41 - Struts 2 IntroductionSession 41 - Struts 2 Introduction
Session 41 - Struts 2 Introduction
 
Struts2
Struts2Struts2
Struts2
 
Struts 2-overview2
Struts 2-overview2Struts 2-overview2
Struts 2-overview2
 
ow.ppt
ow.pptow.ppt
ow.ppt
 
ow.ppt
ow.pptow.ppt
ow.ppt
 

Último

Long journey of Ruby standard library at RubyConf AU 2024
Long journey of Ruby standard library at RubyConf AU 2024Long journey of Ruby standard library at RubyConf AU 2024
Long journey of Ruby standard library at RubyConf AU 2024Hiroshi SHIBATA
 
Potential of AI (Generative AI) in Business: Learnings and Insights
Potential of AI (Generative AI) in Business: Learnings and InsightsPotential of AI (Generative AI) in Business: Learnings and Insights
Potential of AI (Generative AI) in Business: Learnings and InsightsRavi Sanghani
 
Testing tools and AI - ideas what to try with some tool examples
Testing tools and AI - ideas what to try with some tool examplesTesting tools and AI - ideas what to try with some tool examples
Testing tools and AI - ideas what to try with some tool examplesKari Kakkonen
 
Generative AI - Gitex v1Generative AI - Gitex v1.pptx
Generative AI - Gitex v1Generative AI - Gitex v1.pptxGenerative AI - Gitex v1Generative AI - Gitex v1.pptx
Generative AI - Gitex v1Generative AI - Gitex v1.pptxfnnc6jmgwh
 
Tampa BSides - The No BS SOC (slides from April 6, 2024 talk)
Tampa BSides - The No BS SOC (slides from April 6, 2024 talk)Tampa BSides - The No BS SOC (slides from April 6, 2024 talk)
Tampa BSides - The No BS SOC (slides from April 6, 2024 talk)Mark Simos
 
Glenn Lazarus- Why Your Observability Strategy Needs Security Observability
Glenn Lazarus- Why Your Observability Strategy Needs Security ObservabilityGlenn Lazarus- Why Your Observability Strategy Needs Security Observability
Glenn Lazarus- Why Your Observability Strategy Needs Security Observabilityitnewsafrica
 
Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24
Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24
Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24Mark Goldstein
 
Varsha Sewlal- Cyber Attacks on Critical Critical Infrastructure
Varsha Sewlal- Cyber Attacks on Critical Critical InfrastructureVarsha Sewlal- Cyber Attacks on Critical Critical Infrastructure
Varsha Sewlal- Cyber Attacks on Critical Critical Infrastructureitnewsafrica
 
Decarbonising Buildings: Making a net-zero built environment a reality
Decarbonising Buildings: Making a net-zero built environment a realityDecarbonising Buildings: Making a net-zero built environment a reality
Decarbonising Buildings: Making a net-zero built environment a realityIES VE
 
UiPath Community: Communication Mining from Zero to Hero
UiPath Community: Communication Mining from Zero to HeroUiPath Community: Communication Mining from Zero to Hero
UiPath Community: Communication Mining from Zero to HeroUiPathCommunity
 
Digital Tools & AI in Career Development
Digital Tools & AI in Career DevelopmentDigital Tools & AI in Career Development
Digital Tools & AI in Career DevelopmentMahmoud Rabie
 
JET Technology Labs White Paper for Virtualized Security and Encryption Techn...
JET Technology Labs White Paper for Virtualized Security and Encryption Techn...JET Technology Labs White Paper for Virtualized Security and Encryption Techn...
JET Technology Labs White Paper for Virtualized Security and Encryption Techn...amber724300
 
Top 10 Hubspot Development Companies in 2024
Top 10 Hubspot Development Companies in 2024Top 10 Hubspot Development Companies in 2024
Top 10 Hubspot Development Companies in 2024TopCSSGallery
 
Microsoft 365 Copilot: How to boost your productivity with AI – Part one: Ado...
Microsoft 365 Copilot: How to boost your productivity with AI – Part one: Ado...Microsoft 365 Copilot: How to boost your productivity with AI – Part one: Ado...
Microsoft 365 Copilot: How to boost your productivity with AI – Part one: Ado...Nikki Chapple
 
Why device, WIFI, and ISP insights are crucial to supporting remote Microsoft...
Why device, WIFI, and ISP insights are crucial to supporting remote Microsoft...Why device, WIFI, and ISP insights are crucial to supporting remote Microsoft...
Why device, WIFI, and ISP insights are crucial to supporting remote Microsoft...panagenda
 
Landscape Catalogue 2024 Australia-1.pdf
Landscape Catalogue 2024 Australia-1.pdfLandscape Catalogue 2024 Australia-1.pdf
Landscape Catalogue 2024 Australia-1.pdfAarwolf Industries LLC
 
2024 April Patch Tuesday
2024 April Patch Tuesday2024 April Patch Tuesday
2024 April Patch TuesdayIvanti
 
Infrared simulation and processing on Nvidia platforms
Infrared simulation and processing on Nvidia platformsInfrared simulation and processing on Nvidia platforms
Infrared simulation and processing on Nvidia platformsYoss Cohen
 
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...Wes McKinney
 
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...Alkin Tezuysal
 

Último (20)

Long journey of Ruby standard library at RubyConf AU 2024
Long journey of Ruby standard library at RubyConf AU 2024Long journey of Ruby standard library at RubyConf AU 2024
Long journey of Ruby standard library at RubyConf AU 2024
 
Potential of AI (Generative AI) in Business: Learnings and Insights
Potential of AI (Generative AI) in Business: Learnings and InsightsPotential of AI (Generative AI) in Business: Learnings and Insights
Potential of AI (Generative AI) in Business: Learnings and Insights
 
Testing tools and AI - ideas what to try with some tool examples
Testing tools and AI - ideas what to try with some tool examplesTesting tools and AI - ideas what to try with some tool examples
Testing tools and AI - ideas what to try with some tool examples
 
Generative AI - Gitex v1Generative AI - Gitex v1.pptx
Generative AI - Gitex v1Generative AI - Gitex v1.pptxGenerative AI - Gitex v1Generative AI - Gitex v1.pptx
Generative AI - Gitex v1Generative AI - Gitex v1.pptx
 
Tampa BSides - The No BS SOC (slides from April 6, 2024 talk)
Tampa BSides - The No BS SOC (slides from April 6, 2024 talk)Tampa BSides - The No BS SOC (slides from April 6, 2024 talk)
Tampa BSides - The No BS SOC (slides from April 6, 2024 talk)
 
Glenn Lazarus- Why Your Observability Strategy Needs Security Observability
Glenn Lazarus- Why Your Observability Strategy Needs Security ObservabilityGlenn Lazarus- Why Your Observability Strategy Needs Security Observability
Glenn Lazarus- Why Your Observability Strategy Needs Security Observability
 
Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24
Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24
Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24
 
Varsha Sewlal- Cyber Attacks on Critical Critical Infrastructure
Varsha Sewlal- Cyber Attacks on Critical Critical InfrastructureVarsha Sewlal- Cyber Attacks on Critical Critical Infrastructure
Varsha Sewlal- Cyber Attacks on Critical Critical Infrastructure
 
Decarbonising Buildings: Making a net-zero built environment a reality
Decarbonising Buildings: Making a net-zero built environment a realityDecarbonising Buildings: Making a net-zero built environment a reality
Decarbonising Buildings: Making a net-zero built environment a reality
 
UiPath Community: Communication Mining from Zero to Hero
UiPath Community: Communication Mining from Zero to HeroUiPath Community: Communication Mining from Zero to Hero
UiPath Community: Communication Mining from Zero to Hero
 
Digital Tools & AI in Career Development
Digital Tools & AI in Career DevelopmentDigital Tools & AI in Career Development
Digital Tools & AI in Career Development
 
JET Technology Labs White Paper for Virtualized Security and Encryption Techn...
JET Technology Labs White Paper for Virtualized Security and Encryption Techn...JET Technology Labs White Paper for Virtualized Security and Encryption Techn...
JET Technology Labs White Paper for Virtualized Security and Encryption Techn...
 
Top 10 Hubspot Development Companies in 2024
Top 10 Hubspot Development Companies in 2024Top 10 Hubspot Development Companies in 2024
Top 10 Hubspot Development Companies in 2024
 
Microsoft 365 Copilot: How to boost your productivity with AI – Part one: Ado...
Microsoft 365 Copilot: How to boost your productivity with AI – Part one: Ado...Microsoft 365 Copilot: How to boost your productivity with AI – Part one: Ado...
Microsoft 365 Copilot: How to boost your productivity with AI – Part one: Ado...
 
Why device, WIFI, and ISP insights are crucial to supporting remote Microsoft...
Why device, WIFI, and ISP insights are crucial to supporting remote Microsoft...Why device, WIFI, and ISP insights are crucial to supporting remote Microsoft...
Why device, WIFI, and ISP insights are crucial to supporting remote Microsoft...
 
Landscape Catalogue 2024 Australia-1.pdf
Landscape Catalogue 2024 Australia-1.pdfLandscape Catalogue 2024 Australia-1.pdf
Landscape Catalogue 2024 Australia-1.pdf
 
2024 April Patch Tuesday
2024 April Patch Tuesday2024 April Patch Tuesday
2024 April Patch Tuesday
 
Infrared simulation and processing on Nvidia platforms
Infrared simulation and processing on Nvidia platformsInfrared simulation and processing on Nvidia platforms
Infrared simulation and processing on Nvidia platforms
 
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
 
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
 

Jitendra Chittoda discusses sequential concurrency and StripedExecutorService design

  • 1. Jitendra Chittoda, Member Development Department @ ION Trading India Pvt. Ltd. Co-leader Delhi and NCR Java User Group (DaNJUG) Email: jitendra@chittoda.com Twitter: @JChittoda Blog: http://chittoda.com Sequential Concurrency…. WHAT ??? 08 May 20131 JavaOne India 2013 : COM1240
  • 2. Delhi & NCR JUG (DaNJUG) 08 May 20132  30+ Members  Looking for more active members  Meetup.com, Groups  If your friends are in Delhi NCR, please spread the word
  • 3. Agenda  What is ThreadPool  Benefits of using ThreadPool  What we can’t achieve with ThreadPool  Why & Where ?  Sequential Concurrency Fundamentals  SerialExecutor  StripedExecutorService Design  Features  Current State 08 May 20133
  • 5. Benefits of ThreadPool 08 May 20135  Pre-initialized pool of threads  Reusable threads  Configurable
  • 6. What we can’t achieve with ThreadPool 08 May 20136  As per the business requirement, sometimes you may want to process Tasks in specific order.  Tasks execution order is not maintained by the normal ThreadPools  Processing Not Ordered  Processing of a Task is not ordered, you can say its uncertain.
  • 8. Why? Industry Examples 08 May 20138  Exchange trading  Processing of trades on an instrument.  Train Reservations  Ticket booking requests for a train must be processed in FIFO order.  Multi Tenancy  Each tenant want some specific execution to be ordered
  • 9. Where ? 08 May 20139  First saw in 2007 then in 2010 and in 2011  November 2011: Started writing my own implementation, published a blog on http://chittoda.com  November 2012:  http://www.javaspecialists.eu/archive/Issue206.html  Heinz got 5 different implementations after this issue.
  • 10. Sequential Concurrency Fundamentals 08 May 201310 •Identification •Maintaining Order •Sequential Processing •No Dependency
  • 11. Sequential Concurrency Fundamentals 08 May 201311  Identification • Maintain the sequence based on some Stripe or Key • Stripe: An object which is common among the Tasks those needs to be processed in sequence.
  • 12. Sequential Concurrency Fundamentals 08 May 201312  Maintaining Order • Maintain the sequential ordering tasks • FIFO Order
  • 13. Sequential Concurrency Fundamentals 08 May 201313  Sequential Processing  Process tasks of a Stripe in sequence  To maintain this we assign one and only one Thread to a Queue.
  • 14. Sequential Concurrency Fundamentals 08 May 201314  No Dependency  Tasks of one Stripe-X should not be dependent on Tasks of another Stripe-Y
  • 15. Sequential Concurrency 08 May 201315 12 132 Pool of Threads Queue of Stripe StripedExecutorServic e T- 1 T- 2 T- 3
  • 16. Executor JavaDoc 08 May 201316 • Many Executor implementations impose some sort of limitation on how and when tasks are scheduled. The executor below serializes the submission of tasks to a second executor, illustrating a composite executor. class SerialExecutor implements Executor { Queue<Runnable> tasks = new ArrayDeque<>(); Executor executor; Runnable active; SerialExecutor(Executor executor) { this.executor = executor; }
  • 17. SerialExecutor 08 May 201317 public void execute(final Runnable r) { tasks.offer(new Runnable() { public void run() { try { r.run(); } finally { scheduleNext(); } } }); if (active == null) { scheduleNext(); } }
  • 18. SerialExecutor 08 May 201318 protected void scheduleNext() { if ((active = tasks.poll()) != null) { executor.execute(active); } }
  • 19. Pool of SerialExecutor 08 May 201319  SerialExecutor maintain the sequence of the tasks assigned to it and process them in sequence. Using single queue.  BUT we need pool of SerialExecutor, so that we can concurrently execute tasks of two or more Striped Queues
  • 20. Implementation Details 08 May 201320 1) Identification • Stripe: We are using Object as Stripe, you can define your own. 2) Maintain Order • With separate Queue based on Stripe. • SerialExecutor is maintaining a Queue 3) Sequential Processing • Handled by SerialExecutor 4) No Dependency • Handled by SerialExecutor
  • 24. Inside StripedExecutorService 08 May 201324 class SerialExecutor implements Executor { private BlockingQueue<Runnable> tasks = new LinkedBlockingQueue<>(); private Runnable active; private final Object stripe; private SerialExecutor(Object stripe) { this.stripe = stripe; }
  • 25. 08 May 201325 public void execute(final Runnable r) { lock.lock(); try { tasks.add(new Runnable() { public void run() { try { r.run(); } finally { scheduleNext(); } } }); if (active == null){ scheduleNext(); } } finally { lock.unlock(); } }
  • 26. Inside StripedExecutorService 08 May 201326 private void scheduleNext() { lock.lock(); try { if ((active = tasks.poll()) != null) { executor.execute(active); terminating.signalAll(); } else { removeEmptySerialExecutor(stripe, this); } } finally { lock.unlock(); } }
  • 27. 08 May 201327 private final ExecutorService executor; private final Map<Object, SerialExecutor> executors = new IdentityHashMap<>(); public void execute(Runnable command) { lock.lock(); try { Object stripe = getStripe(command); if (stripe != null) { SerialExecutor ser_exec= executors.get(stripe); if (ser_exec == null) { executors.put(stripe, ser_exec= new SerialExecutor(stripe)); } ser_exec.execute(command); } else { executor.execute(command); } } finally { lock.unlock(); } }
  • 28. Features 08 May 201328  Non striped tasks can also be handled with SES  Queues gets created when required  No memory leaks in terms of the Queues. Queues gets removed once all tasks are finished.
  • 29. Current State 08 May 201329  Work In Progress  Several other implementations available, but no one passes the tests written for StripedExecutorService  Performance
  • 30. References 08 May 201330  Delhi & NCR JUG  https://groups.google.com/d/forum/dncrjug  GitHub :  https://github.com/kabutz/striped-executor-service  Dr. Heinz Kabutz Newsletter  http://www.javaspecialists.eu/archive/Issue206.html  http://www.javaspecialists.eu/  Blog  http://chittoda.com