SlideShare una empresa de Scribd logo
1 de 23
Fork/Join for Fun and Profit!




               @Sander_Mak
What is the problem anyway?
What is the problem anyway?
What is the problem anyway?
What is the problem anyway?
‣ So let the Compiler figure out the hard stuff!
          if (n < 2) n else fib(n - 1) + fib(n - 2)



                          n < 2




                 n




‣ Or maybe not ...
Fork/Join in pictures

Fork:
Recursively decompose
                                              Result
large task into subtasks
                                              Task 1

Join:                           Task 2                 Task 3
Await results of
recursive tasks            Task 4    Task 5       Task 6    Task 7

and combine
Fork/Join in pseudocode


compute(problem) {
  if (problem.size < threshold)
    directlySolve(problem)
  else {
    do-forked {
       leftResult = compute(left(problem))
       rightResult = compute(right(problem))
    }
    join(leftResult, rightResult)
    return combine(leftResult, rightResult)
  }
}
ForkJoinPool


Introducing:
  java.uCl.concurrent.ForkJoinPool
                                               ForkJoinTask
  java.uCl.concurrent.ForkJoinTask


                                     RecursiveAction   RecursiveTask
ForkJoinPool:
void            execute (ForkJoinTask<?>)
T               invoke (ForkJoinTask<T>)
ForkJoinTask<T> submit (ForkJoinTask<T>)
  
ForkJoinPool


Introducing:
  java.uCl.concurrent.ForkJoinPool   Worker 1



‣    Implements ExecutorService
‣    Autosizing workers              Worker 2
‣    Double‐ended queue
‣    Workstealing algorithm
                                     Worker 3
  
Sorting demo



Mergesort
ForkJoinTasks

‣ 100 < ‘basic computaConal steps’ < 10.000
‣ Acyclic, typically decreasing in size
‣ Join doesn’t block thread!
‣ Do: 
    ‣ OpCmize sequenCal threshold
    ‣ Share, don’t copy input (task locality)
‣ Don’t:
    ‣ Synchronize/lock (but use: Phaser)
    ‣ Do blocking I/O
Work stealing




Worker 1         Worker 2   Worker 3


           ForkJoinPool
Speedups
What about threads?


‣ Heavyweight (try starCng a million)
‣ Implicit dependencies between tasks
   ‣ Manual synchronizaCon
   ‣ Deadlock/livelock/race condiCons
‣ Hard to scale to available parallelism
Pooling/ExecutorService then?


‣ ForkJoinPool implements ExecutorService
‣ Coarse‐grained independent tasks
‣ Recursively decomposed tasks spend most Cme 
  waiCng
   ‣ In normal threadpool: starvaCon
‣ Task‐queue of threadpool‐backed ExecutorService not 
  opCmized for many small tasks
‣ No workstealing
Map/Reduce?




Environment    Single JVM          Cluster

Model          Recursive forking   O^en single map

Scales with    Cores/CPUs          Nodes

Worker         Workstealing        No inter‐node 
interacDon                         communicaCon
Demo


Sony’s been hacked...




            Are we compromised...?
Fork/Join and


‣ ForkJoinPool starts threads
  ‣ Illegal in EJBs
  ‣ Fair game in servlets/CDI beans
‣ Don’t create ForkJoinPool for each request
‣ Idea: WorkManager to create poolthreads
‣ Single pool, async submit(ForkJoinTask)
  ‣ Don’t Ce up request thread: Servlet 3.0
Alternatives outside Java?


‣   Actors
‣   So^ware transacConal memory
‣   Dataflow concurrency
‣   Agents
‣   ... Some of this built on F/J



            Akka                    GPars
Criticism


‣ ImplementaCon too complex (uses Unsafe)
‣ Some assumpCons quesConable
   ‣ 1‐1 mapping workerthread/OS thread
   ‣ Workstealing best opCon?
‣ Scalability 100+ cores?
Future
                                                               GPU?
                                                 Java 8        OpenCL?

                                     Java 7
                                                 Parallel
                 Java 5                          Collections
                                     Fork/Join
Java
1.0 - 1.4        - j.u.concurrent:
                 high-level locks,
                 concurrent coll.
- threads
- synchronized
- volatile
Future




int scanLog(List<String> lines, String query) {
   Pattern p = ...
   return lines.parallel()
               .filter(s => p.matcher(s).matches())
               .count();

}
ForkJoinPool.shutDownNow()


       Questions?




Code @ bit.ly/jfall-forkjoin

Más contenido relacionado

La actualidad más candente

Streams, Streams Everywhere! An Introduction to Rx
Streams, Streams Everywhere! An Introduction to RxStreams, Streams Everywhere! An Introduction to Rx
Streams, Streams Everywhere! An Introduction to RxAndrzej Sitek
 
Reactive Programming on Android - RxAndroid - RxJava
Reactive Programming on Android - RxAndroid - RxJavaReactive Programming on Android - RxAndroid - RxJava
Reactive Programming on Android - RxAndroid - RxJavaAli Muzaffar
 
Java Concurrency, Memory Model, and Trends
Java Concurrency, Memory Model, and TrendsJava Concurrency, Memory Model, and Trends
Java Concurrency, Memory Model, and TrendsCarol McDonald
 
Threads and concurrency in Java 1.5
Threads and concurrency in Java 1.5Threads and concurrency in Java 1.5
Threads and concurrency in Java 1.5Peter Antman
 
The Future of Futures - A Talk About Java 8 CompletableFutures
The Future of Futures - A Talk About Java 8 CompletableFuturesThe Future of Futures - A Talk About Java 8 CompletableFutures
The Future of Futures - A Talk About Java 8 CompletableFuturesHaim Yadid
 
Practical RxJava for Android
Practical RxJava for AndroidPractical RxJava for Android
Practical RxJava for AndroidTomáš Kypta
 
From Java 6 to Java 7 reference
From Java 6 to Java 7 referenceFrom Java 6 to Java 7 reference
From Java 6 to Java 7 referenceGiacomo Veneri
 
Wait for your fortune without Blocking!
Wait for your fortune without Blocking!Wait for your fortune without Blocking!
Wait for your fortune without Blocking!Roman Elizarov
 
Reactive Android: RxJava and beyond
Reactive Android: RxJava and beyondReactive Android: RxJava and beyond
Reactive Android: RxJava and beyondFabio Tiriticco
 
Building Scalable Stateless Applications with RxJava
Building Scalable Stateless Applications with RxJavaBuilding Scalable Stateless Applications with RxJava
Building Scalable Stateless Applications with RxJavaRick Warren
 
Reactive programming with examples
Reactive programming with examplesReactive programming with examples
Reactive programming with examplesPeter Lawrey
 
Functional Reactive Programming / Compositional Event Systems
Functional Reactive Programming / Compositional Event SystemsFunctional Reactive Programming / Compositional Event Systems
Functional Reactive Programming / Compositional Event SystemsLeonardo Borges
 
Java Concurrency in Practice
Java Concurrency in PracticeJava Concurrency in Practice
Java Concurrency in PracticeAlina Dolgikh
 
Real world functional reactive programming
Real world functional reactive programmingReal world functional reactive programming
Real world functional reactive programmingEric Polerecky
 
Modern Java Workshop
Modern Java WorkshopModern Java Workshop
Modern Java WorkshopSimon Ritter
 

La actualidad más candente (20)

Streams, Streams Everywhere! An Introduction to Rx
Streams, Streams Everywhere! An Introduction to RxStreams, Streams Everywhere! An Introduction to Rx
Streams, Streams Everywhere! An Introduction to Rx
 
Reactive Java (GeeCON 2014)
Reactive Java (GeeCON 2014)Reactive Java (GeeCON 2014)
Reactive Java (GeeCON 2014)
 
Reactive Programming on Android - RxAndroid - RxJava
Reactive Programming on Android - RxAndroid - RxJavaReactive Programming on Android - RxAndroid - RxJava
Reactive Programming on Android - RxAndroid - RxJava
 
Introduction to Reactive Java
Introduction to Reactive JavaIntroduction to Reactive Java
Introduction to Reactive Java
 
Java Concurrency, Memory Model, and Trends
Java Concurrency, Memory Model, and TrendsJava Concurrency, Memory Model, and Trends
Java Concurrency, Memory Model, and Trends
 
Threads and concurrency in Java 1.5
Threads and concurrency in Java 1.5Threads and concurrency in Java 1.5
Threads and concurrency in Java 1.5
 
The Future of Futures - A Talk About Java 8 CompletableFutures
The Future of Futures - A Talk About Java 8 CompletableFuturesThe Future of Futures - A Talk About Java 8 CompletableFutures
The Future of Futures - A Talk About Java 8 CompletableFutures
 
Practical RxJava for Android
Practical RxJava for AndroidPractical RxJava for Android
Practical RxJava for Android
 
RxJava@DAUG
RxJava@DAUGRxJava@DAUG
RxJava@DAUG
 
From Java 6 to Java 7 reference
From Java 6 to Java 7 referenceFrom Java 6 to Java 7 reference
From Java 6 to Java 7 reference
 
Wait for your fortune without Blocking!
Wait for your fortune without Blocking!Wait for your fortune without Blocking!
Wait for your fortune without Blocking!
 
Reactive Android: RxJava and beyond
Reactive Android: RxJava and beyondReactive Android: RxJava and beyond
Reactive Android: RxJava and beyond
 
Building Scalable Stateless Applications with RxJava
Building Scalable Stateless Applications with RxJavaBuilding Scalable Stateless Applications with RxJava
Building Scalable Stateless Applications with RxJava
 
Java 7 & 8
Java 7 & 8Java 7 & 8
Java 7 & 8
 
Reactive programming with examples
Reactive programming with examplesReactive programming with examples
Reactive programming with examples
 
The Java memory model made easy
The Java memory model made easyThe Java memory model made easy
The Java memory model made easy
 
Functional Reactive Programming / Compositional Event Systems
Functional Reactive Programming / Compositional Event SystemsFunctional Reactive Programming / Compositional Event Systems
Functional Reactive Programming / Compositional Event Systems
 
Java Concurrency in Practice
Java Concurrency in PracticeJava Concurrency in Practice
Java Concurrency in Practice
 
Real world functional reactive programming
Real world functional reactive programmingReal world functional reactive programming
Real world functional reactive programming
 
Modern Java Workshop
Modern Java WorkshopModern Java Workshop
Modern Java Workshop
 

Destacado

Don't get stung - an introduction to the OWASP Top 10
Don't get stung - an introduction to the OWASP Top 10Don't get stung - an introduction to the OWASP Top 10
Don't get stung - an introduction to the OWASP Top 10Barry Dorrans
 
Blogstarz Presentation Ter Baru
Blogstarz Presentation Ter BaruBlogstarz Presentation Ter Baru
Blogstarz Presentation Ter Barumusslizz
 
Knowmads opdracht februari 2011
Knowmads opdracht februari 2011Knowmads opdracht februari 2011
Knowmads opdracht februari 2011francienvaneersel
 
Presentacion I Cities 2009
Presentacion I Cities 2009Presentacion I Cities 2009
Presentacion I Cities 2009Fernando Martin
 
Embedded linux in_timeandspace_weinberg_2
Embedded linux in_timeandspace_weinberg_2Embedded linux in_timeandspace_weinberg_2
Embedded linux in_timeandspace_weinberg_2hamed sheykhlu
 
Linked In Transaction Offer
Linked In Transaction OfferLinked In Transaction Offer
Linked In Transaction OfferVincent_Mills
 
VU University Amsterdam - The Social Web 2016 - Lecture 3
VU University Amsterdam - The Social Web 2016 - Lecture 3VU University Amsterdam - The Social Web 2016 - Lecture 3
VU University Amsterdam - The Social Web 2016 - Lecture 3Davide Ceolin
 
Select Samples of Work
Select Samples of WorkSelect Samples of Work
Select Samples of Worklizzygreen
 
以共融的觀點探討銀髮族節能生活型態之概念設計計畫
以共融的觀點探討銀髮族節能生活型態之概念設計計畫以共融的觀點探討銀髮族節能生活型態之概念設計計畫
以共融的觀點探討銀髮族節能生活型態之概念設計計畫開放式概念發表平臺
 
應用微機電感測科技開發未來智慧生活產品
應用微機電感測科技開發未來智慧生活產品應用微機電感測科技開發未來智慧生活產品
應用微機電感測科技開發未來智慧生活產品開放式概念發表平臺
 
"Зарядиська"
"Зарядиська""Зарядиська"
"Зарядиська"unDrei
 
Integrating Social Media With Traditional Media
Integrating Social Media With Traditional MediaIntegrating Social Media With Traditional Media
Integrating Social Media With Traditional Mediaparkernow
 

Destacado (20)

Introduction àJava
Introduction àJavaIntroduction àJava
Introduction àJava
 
Don't get stung - an introduction to the OWASP Top 10
Don't get stung - an introduction to the OWASP Top 10Don't get stung - an introduction to the OWASP Top 10
Don't get stung - an introduction to the OWASP Top 10
 
Blogstarz Presentation Ter Baru
Blogstarz Presentation Ter BaruBlogstarz Presentation Ter Baru
Blogstarz Presentation Ter Baru
 
jo s term4 eport
jo s term4 eportjo s term4 eport
jo s term4 eport
 
Knowmads opdracht februari 2011
Knowmads opdracht februari 2011Knowmads opdracht februari 2011
Knowmads opdracht februari 2011
 
Bodene's term 4 eport
Bodene's term 4 eportBodene's term 4 eport
Bodene's term 4 eport
 
Presentacion I Cities 2009
Presentacion I Cities 2009Presentacion I Cities 2009
Presentacion I Cities 2009
 
Embedded linux in_timeandspace_weinberg_2
Embedded linux in_timeandspace_weinberg_2Embedded linux in_timeandspace_weinberg_2
Embedded linux in_timeandspace_weinberg_2
 
Linked In Transaction Offer
Linked In Transaction OfferLinked In Transaction Offer
Linked In Transaction Offer
 
Unenclosable
UnenclosableUnenclosable
Unenclosable
 
VU University Amsterdam - The Social Web 2016 - Lecture 3
VU University Amsterdam - The Social Web 2016 - Lecture 3VU University Amsterdam - The Social Web 2016 - Lecture 3
VU University Amsterdam - The Social Web 2016 - Lecture 3
 
Ideas - Magzine Advert
Ideas - Magzine AdvertIdeas - Magzine Advert
Ideas - Magzine Advert
 
Select Samples of Work
Select Samples of WorkSelect Samples of Work
Select Samples of Work
 
以共融的觀點探討銀髮族節能生活型態之概念設計計畫
以共融的觀點探討銀髮族節能生活型態之概念設計計畫以共融的觀點探討銀髮族節能生活型態之概念設計計畫
以共融的觀點探討銀髮族節能生活型態之概念設計計畫
 
應用微機電感測科技開發未來智慧生活產品
應用微機電感測科技開發未來智慧生活產品應用微機電感測科技開發未來智慧生活產品
應用微機電感測科技開發未來智慧生活產品
 
evaluation
evaluationevaluation
evaluation
 
Symbionomics
SymbionomicsSymbionomics
Symbionomics
 
Unenclosable
UnenclosableUnenclosable
Unenclosable
 
"Зарядиська"
"Зарядиська""Зарядиська"
"Зарядиська"
 
Integrating Social Media With Traditional Media
Integrating Social Media With Traditional MediaIntegrating Social Media With Traditional Media
Integrating Social Media With Traditional Media
 

Similar a Fork/Join for Fun and Profit!

Concurrency with side-effects – cats way
Concurrency with side-effects – cats wayConcurrency with side-effects – cats way
Concurrency with side-effects – cats waystasimus
 
TorqueBox at DC:JBUG - November 2011
TorqueBox at DC:JBUG - November 2011TorqueBox at DC:JBUG - November 2011
TorqueBox at DC:JBUG - November 2011bobmcwhirter
 
NYAN Conference: Debugging asynchronous scenarios in .net
NYAN Conference: Debugging asynchronous scenarios in .netNYAN Conference: Debugging asynchronous scenarios in .net
NYAN Conference: Debugging asynchronous scenarios in .netAlexandra Hayere
 
Our challenge for Bulkload reliability improvement
Our challenge for Bulkload reliability  improvementOur challenge for Bulkload reliability  improvement
Our challenge for Bulkload reliability improvementSatoshi Akama
 
Clojure 1.1 And Beyond
Clojure 1.1 And BeyondClojure 1.1 And Beyond
Clojure 1.1 And BeyondMike Fogus
 
Java if and else
Java if and elseJava if and else
Java if and elsepratik8897
 
Why scala is not my ideal language and what I can do with this
Why scala is not my ideal language and what I can do with thisWhy scala is not my ideal language and what I can do with this
Why scala is not my ideal language and what I can do with thisRuslan Shevchenko
 
Asynchronous development in JavaScript
Asynchronous development  in JavaScriptAsynchronous development  in JavaScript
Asynchronous development in JavaScriptAmitai Barnea
 
Adopting GraalVM - Scale by the Bay 2018
Adopting GraalVM - Scale by the Bay 2018Adopting GraalVM - Scale by the Bay 2018
Adopting GraalVM - Scale by the Bay 2018Petr Zapletal
 
Async and parallel patterns and application design - TechDays2013 NL
Async and parallel patterns and application design - TechDays2013 NLAsync and parallel patterns and application design - TechDays2013 NL
Async and parallel patterns and application design - TechDays2013 NLArie Leeuwesteijn
 
Java basic tutorial by sanjeevini india
Java basic tutorial by sanjeevini indiaJava basic tutorial by sanjeevini india
Java basic tutorial by sanjeevini indiaSanjeev Tripathi
 
Java basic tutorial by sanjeevini india
Java basic tutorial by sanjeevini indiaJava basic tutorial by sanjeevini india
Java basic tutorial by sanjeevini indiasanjeeviniindia1186
 
Bugs from Outer Space | while42 SF #6
Bugs from Outer Space | while42 SF #6Bugs from Outer Space | while42 SF #6
Bugs from Outer Space | while42 SF #6While42
 
4Developers 2015: Programowanie synchroniczne i asynchroniczne - dwa światy k...
4Developers 2015: Programowanie synchroniczne i asynchroniczne - dwa światy k...4Developers 2015: Programowanie synchroniczne i asynchroniczne - dwa światy k...
4Developers 2015: Programowanie synchroniczne i asynchroniczne - dwa światy k...PROIDEA
 
JDD2015: Frege - Introducing purely functional programming on the JVM - Dierk...
JDD2015: Frege - Introducing purely functional programming on the JVM - Dierk...JDD2015: Frege - Introducing purely functional programming on the JVM - Dierk...
JDD2015: Frege - Introducing purely functional programming on the JVM - Dierk...PROIDEA
 
Ten Man-Years of JavaFX: Real World Project Experiences
Ten Man-Years of JavaFX: Real World Project ExperiencesTen Man-Years of JavaFX: Real World Project Experiences
Ten Man-Years of JavaFX: Real World Project ExperiencesHenrik Olsson
 

Similar a Fork/Join for Fun and Profit! (20)

Concurrency with side-effects – cats way
Concurrency with side-effects – cats wayConcurrency with side-effects – cats way
Concurrency with side-effects – cats way
 
TorqueBox at DC:JBUG - November 2011
TorqueBox at DC:JBUG - November 2011TorqueBox at DC:JBUG - November 2011
TorqueBox at DC:JBUG - November 2011
 
NYAN Conference: Debugging asynchronous scenarios in .net
NYAN Conference: Debugging asynchronous scenarios in .netNYAN Conference: Debugging asynchronous scenarios in .net
NYAN Conference: Debugging asynchronous scenarios in .net
 
Our challenge for Bulkload reliability improvement
Our challenge for Bulkload reliability  improvementOur challenge for Bulkload reliability  improvement
Our challenge for Bulkload reliability improvement
 
Clojure 1.1 And Beyond
Clojure 1.1 And BeyondClojure 1.1 And Beyond
Clojure 1.1 And Beyond
 
Java if and else
Java if and elseJava if and else
Java if and else
 
Why scala is not my ideal language and what I can do with this
Why scala is not my ideal language and what I can do with thisWhy scala is not my ideal language and what I can do with this
Why scala is not my ideal language and what I can do with this
 
Asynchronous development in JavaScript
Asynchronous development  in JavaScriptAsynchronous development  in JavaScript
Asynchronous development in JavaScript
 
Adopting GraalVM - Scale by the Bay 2018
Adopting GraalVM - Scale by the Bay 2018Adopting GraalVM - Scale by the Bay 2018
Adopting GraalVM - Scale by the Bay 2018
 
Kotlin Coroutines and Rx
Kotlin Coroutines and RxKotlin Coroutines and Rx
Kotlin Coroutines and Rx
 
Async and parallel patterns and application design - TechDays2013 NL
Async and parallel patterns and application design - TechDays2013 NLAsync and parallel patterns and application design - TechDays2013 NL
Async and parallel patterns and application design - TechDays2013 NL
 
Java basic tutorial by sanjeevini india
Java basic tutorial by sanjeevini indiaJava basic tutorial by sanjeevini india
Java basic tutorial by sanjeevini india
 
Java basic tutorial by sanjeevini india
Java basic tutorial by sanjeevini indiaJava basic tutorial by sanjeevini india
Java basic tutorial by sanjeevini india
 
Bugs from Outer Space | while42 SF #6
Bugs from Outer Space | while42 SF #6Bugs from Outer Space | while42 SF #6
Bugs from Outer Space | while42 SF #6
 
Embracing Events
Embracing EventsEmbracing Events
Embracing Events
 
4Developers 2015: Programowanie synchroniczne i asynchroniczne - dwa światy k...
4Developers 2015: Programowanie synchroniczne i asynchroniczne - dwa światy k...4Developers 2015: Programowanie synchroniczne i asynchroniczne - dwa światy k...
4Developers 2015: Programowanie synchroniczne i asynchroniczne - dwa światy k...
 
JDD2015: Frege - Introducing purely functional programming on the JVM - Dierk...
JDD2015: Frege - Introducing purely functional programming on the JVM - Dierk...JDD2015: Frege - Introducing purely functional programming on the JVM - Dierk...
JDD2015: Frege - Introducing purely functional programming on the JVM - Dierk...
 
Ndp Slides
Ndp SlidesNdp Slides
Ndp Slides
 
Ten Man-Years of JavaFX: Real World Project Experiences
Ten Man-Years of JavaFX: Real World Project ExperiencesTen Man-Years of JavaFX: Real World Project Experiences
Ten Man-Years of JavaFX: Real World Project Experiences
 
Functional programming
Functional programmingFunctional programming
Functional programming
 

Más de Sander Mak (@Sander_Mak)

TypeScript: coding JavaScript without the pain
TypeScript: coding JavaScript without the painTypeScript: coding JavaScript without the pain
TypeScript: coding JavaScript without the painSander Mak (@Sander_Mak)
 
The Ultimate Dependency Manager Shootout (QCon NY 2014)
The Ultimate Dependency Manager Shootout (QCon NY 2014)The Ultimate Dependency Manager Shootout (QCon NY 2014)
The Ultimate Dependency Manager Shootout (QCon NY 2014)Sander Mak (@Sander_Mak)
 
Cross-Build Injection attacks: how safe is your Java build?
Cross-Build Injection attacks: how safe is your Java build?Cross-Build Injection attacks: how safe is your Java build?
Cross-Build Injection attacks: how safe is your Java build?Sander Mak (@Sander_Mak)
 
Hibernate Performance Tuning (JEEConf 2012)
Hibernate Performance Tuning (JEEConf 2012)Hibernate Performance Tuning (JEEConf 2012)
Hibernate Performance Tuning (JEEConf 2012)Sander Mak (@Sander_Mak)
 

Más de Sander Mak (@Sander_Mak) (20)

Scalable Application Development @ Picnic
Scalable Application Development @ PicnicScalable Application Development @ Picnic
Scalable Application Development @ Picnic
 
Coding Your Way to Java 13
Coding Your Way to Java 13Coding Your Way to Java 13
Coding Your Way to Java 13
 
Coding Your Way to Java 12
Coding Your Way to Java 12Coding Your Way to Java 12
Coding Your Way to Java 12
 
Java Modularity: the Year After
Java Modularity: the Year AfterJava Modularity: the Year After
Java Modularity: the Year After
 
Desiging for Modularity with Java 9
Desiging for Modularity with Java 9Desiging for Modularity with Java 9
Desiging for Modularity with Java 9
 
Modules or microservices?
Modules or microservices?Modules or microservices?
Modules or microservices?
 
Migrating to Java 9 Modules
Migrating to Java 9 ModulesMigrating to Java 9 Modules
Migrating to Java 9 Modules
 
Java 9 Modularity in Action
Java 9 Modularity in ActionJava 9 Modularity in Action
Java 9 Modularity in Action
 
Java modularity: life after Java 9
Java modularity: life after Java 9Java modularity: life after Java 9
Java modularity: life after Java 9
 
Provisioning the IoT
Provisioning the IoTProvisioning the IoT
Provisioning the IoT
 
Event-sourced architectures with Akka
Event-sourced architectures with AkkaEvent-sourced architectures with Akka
Event-sourced architectures with Akka
 
TypeScript: coding JavaScript without the pain
TypeScript: coding JavaScript without the painTypeScript: coding JavaScript without the pain
TypeScript: coding JavaScript without the pain
 
The Ultimate Dependency Manager Shootout (QCon NY 2014)
The Ultimate Dependency Manager Shootout (QCon NY 2014)The Ultimate Dependency Manager Shootout (QCon NY 2014)
The Ultimate Dependency Manager Shootout (QCon NY 2014)
 
Modular JavaScript
Modular JavaScriptModular JavaScript
Modular JavaScript
 
Modularity in the Cloud
Modularity in the CloudModularity in the Cloud
Modularity in the Cloud
 
Cross-Build Injection attacks: how safe is your Java build?
Cross-Build Injection attacks: how safe is your Java build?Cross-Build Injection attacks: how safe is your Java build?
Cross-Build Injection attacks: how safe is your Java build?
 
Scala & Lift (JEEConf 2012)
Scala & Lift (JEEConf 2012)Scala & Lift (JEEConf 2012)
Scala & Lift (JEEConf 2012)
 
Hibernate Performance Tuning (JEEConf 2012)
Hibernate Performance Tuning (JEEConf 2012)Hibernate Performance Tuning (JEEConf 2012)
Hibernate Performance Tuning (JEEConf 2012)
 
Akka (BeJUG)
Akka (BeJUG)Akka (BeJUG)
Akka (BeJUG)
 
Kscope11 recap
Kscope11 recapKscope11 recap
Kscope11 recap
 

Último

GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdflior mazor
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityPrincipled Technologies
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdfhans926745
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Enterprise Knowledge
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsJoaquim Jorge
 
Developing An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of BrazilDeveloping An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of BrazilV3cube
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century educationjfdjdjcjdnsjd
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUK Journal
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptxHampshireHUG
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...DianaGray10
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsMaria Levchenko
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...apidays
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Drew Madelung
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)Gabriella Davis
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slidevu2urc
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)wesley chun
 
Tech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdfTech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdfhans926745
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024Rafal Los
 

Último (20)

GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdf
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 
Developing An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of BrazilDeveloping An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of Brazil
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
Tech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdfTech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdf
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 

Fork/Join for Fun and Profit!

Notas del editor

  1. Sander Mak, Info Support\nGaan het hebben over Doug Lea&amp;#x2019;s fork/join (al sinds 1998 in the works), nu onderdeel van Java7\nFun &amp; Profit: profit vanwege snellere apps, fun hangt van je interesses af :)\n
  2. No choice but to churn on each task sequentially\nPentium 5, 3.4Ghz -&gt; hitting physical limits! (approach: speed, smarter instructions onchip)\nThreading alleviates IO contention, not CPU contention\n
  3. No choice but to churn on each task sequentially\nPentium 5, 3.4Ghz -&gt; hitting physical limits! (approach: speed, smarter instructions onchip)\nThreading alleviates IO contention, not CPU contention\n
  4. More cores, lower speed. Do nothing -&gt; your app could be slower! Embrace parallelism.\nIn webapps we get a lot of request-oriented parallelism for free.\nWhat about other applications/algorithms?\n
  5. CPU architectures changed all the time without having to change Java code... why is this different? -&gt; Implicit data-dependencies in code (also, shared memory/state problems)\n
  6. Builds a tree with explicit dependencies between tasks!\nDivide-and-conquer algorithms\nHier: 6 fork acties, 6 join acties\n
  7. Threshold is key: overhead vs. effective work per unit\nApplicable to for example:search, sort, aggregating data\n
  8. ForkJoinTask is a future\n
  9. - getAvailableProcessors on System.runtime\n- possible to set own size (e.g. restrict to 4 of n cores)\n
  10. \n
  11. \n
  12. - forked tasks pushed on top local deque\n- idle worker steals from bottom deque of other worker -&gt; prevent contention on deque, and largest tasks get stolen!\n- no work stolen? eventually yield workerthread. Typ. 0-2% stolen\n- Workstealing == loadbalancing without central coord!\n
  13. Fibonacci in het begin bekeken. Allemaal reken-intensief.\nSprekend voorbeeld: password hashes tegen rainbow table aanhouden.\n
  14. Still threads are better when doing blocking I/O networking etc.\n
  15. \n
  16. F/J: recursively apply same task, M/R: apply different map/reduce steps, not necessarily recursive (but could happen)\n
  17. \n
  18. Websphere staat bv ook geen threadcreatie in servlet toe\nEvt. JCA adapter noemen\n
  19. \n
  20. \n
  21. \n
  22. needs lambdas!\nbut already available in jsr166y with anonymous inner classes\n
  23. \n