SlideShare uma empresa Scribd logo
1 de 35
Baixar para ler offline
Copyright © 2018 Russel Winder 1
On Concurrency and Parallelism
in the JVMVerse
Russel Winder
@russel_winder
russel@winder.org.uk
https://www.russel.org.uk
Copyright © 2018 Russel Winder 2
The Presenter
● Ex theoretical physicist
● Ex UNIX systems programmer
●
Ex academic:
– Parallel programming
– Software development and programming
– HCI, UI, UX
● Ex Company director
● Ex Independent consultant
● Ex analyst
● Ex author
● Ex expert witness
● Ex trainer
Russel Winder
Copyright © 2018 Russel Winder 3
Me at Previous JAXLondons
● 2011
”Just Keep Passing the
Messages”
● 2012
”it’S All About Processes
Communicating”
Also many sessions at other conferences
Copyright © 2018 Russel Winder 4
Concurrency
●
dictionary.com – concurrence
– the act of concurring.
– accordance in opinion; agreement:
With the concurrence of several
specialists, our doctor
recommended surgery.
– cooperation, as of agents or
causes; combined action or effort.
● Wikipedia – concurrency
– In computer science,
concurrency refers to the ability
of different parts or units of a
program, algorithm, or problem to
be executed out-of-order or in
partial order, without affecting
the final outcome.
Copyright © 2018 Russel Winder 5
Parallelism
● dictionary.com – parallelism
– the position or relation of
parallels.
– agreement in direction, tendency,
or character; the state or
condition of being parallel.
– a parallel or comparison.
● Wikipedia – parallelism
– Parallel computing is a type
of computation in which
many calculations or the
execution of processes are
carried out simultaneously.
Copyright © 2018 Russel Winder 6
Original computing:
single CPU, single program
Copyright © 2018 Russel Winder 7
Multitasking: single CPU, many programs
Copyright © 2018 Russel Winder 8
Five programs, one CPU
Copyright © 2018 Russel Winder 9
OS manages all the programs in one memory,
eventually get virtual memory, in the mean time locks,
semaphores, monitors, mutexes, and the theory of
concurrency get invented.
Copyright © 2018 Russel Winder 10
Five programs, one CPU
Copyright © 2018 Russel Winder 11
Five programs, four CPUs
Copyright © 2018 Russel Winder 12
Moving from operating systems
to applications
Copyright © 2018 Russel Winder 13
One program, one task, one CPU
Copyright © 2018 Russel Winder 14
One program, four tasks, one CPU
Copyright © 2018 Russel Winder 15
One program, four tasks, four CPUs
Copyright © 2018 Russel Winder 16
One program, four tasks, four CPUs
Copyright © 2018 Russel Winder 17
Locks, mutexes, sempahores, monitors
are the enemy of parallelism
Copyright © 2018 Russel Winder 18
What is the problem…
Copyright © 2018 Russel Winder 19
Shared Memory
Copyright © 2018 Russel Winder 20
A Bit of Java History
● 1995 — Java introduces threads, multithreading, monitors,
synchronized, locks, etc.
● 1996 — People predict lots of tears and grief.
● 2002 —Doug Lea gets JSR166 moving.
● 2011 — Fork/Join framework in Java 7.
Copyright © 2018 Russel Winder 21
A Bit More Java History
● 2014 — Java 8 introduces:
– Lambda Expressions,
– Streams, and
– CompletableFuture.
Copyright © 2018 Russel Winder 22
Abstract code away from the details of
managing concurrency and parallelism.
Copyright © 2018 Russel Winder 23
Copyright © 2018 Russel Winder 24
Pipeline
Copyright © 2018 Russel Winder 25
Dataflow
Copyright © 2018 Russel Winder 26
Actors
Copyright © 2018 Russel Winder 27
Distributed System
Copyright © 2018 Russel Winder 28
Microservices
Copyright © 2018 Russel Winder 29
Independent processes/tasks/programs
communicating by message passing
Copyright © 2018 Russel Winder 30
Data Parallel
Copyright © 2018 Russel Winder 31
Event Processing
Copyright © 2018 Russel Winder 32
One program, four tasks
Copyright © 2018 Russel Winder 33
Have we seen the code yet?
Copyright © 2018 Russel Winder 34
Summary
● Gpars (Groovy)
● Quasar
● Kotlin Coroutines
Can Java catch up (again).
Copyright © 2018 Russel Winder 35
On Concurrency and Parallelism
in the JVMVerse
Russel Winder
@russel_winder
russel@winder.org.uk
https://www.russel.org.uk

Mais conteúdo relacionado

Semelhante a On Concurrency and Parallelism in the JVMverse

1 introduction to linux os
1 introduction to linux os1 introduction to linux os
1 introduction to linux os
Sukkur IBA
 
GitOps for Helm Users by Scott Rigby
GitOps for Helm Users by Scott RigbyGitOps for Helm Users by Scott Rigby
GitOps for Helm Users by Scott Rigby
Weaveworks
 

Semelhante a On Concurrency and Parallelism in the JVMverse (20)

GPars Workshop
GPars WorkshopGPars Workshop
GPars Workshop
 
Using MySQL Containers
Using MySQL ContainersUsing MySQL Containers
Using MySQL Containers
 
GPars 2014
GPars 2014GPars 2014
GPars 2014
 
Let’s talk about reproducible data analysis
Let’s talk about reproducible data analysisLet’s talk about reproducible data analysis
Let’s talk about reproducible data analysis
 
Interactive and reproducible data analysis with the open-source KNIME Analyti...
Interactive and reproducible data analysis with the open-source KNIME Analyti...Interactive and reproducible data analysis with the open-source KNIME Analyti...
Interactive and reproducible data analysis with the open-source KNIME Analyti...
 
Career opportunities in open source framework
Career opportunities in open source frameworkCareer opportunities in open source framework
Career opportunities in open source framework
 
Career opportunities in open source framework
Career opportunities in open source framework Career opportunities in open source framework
Career opportunities in open source framework
 
Is React The Best Thing Since Sliced Bread?
Is React The Best Thing Since Sliced Bread?Is React The Best Thing Since Sliced Bread?
Is React The Best Thing Since Sliced Bread?
 
Federating Subversion and Git
Federating Subversion and GitFederating Subversion and Git
Federating Subversion and Git
 
Ongoing management of your PHP 7 application
Ongoing management of your PHP 7 applicationOngoing management of your PHP 7 application
Ongoing management of your PHP 7 application
 
1 introduction to linux os
1 introduction to linux os1 introduction to linux os
1 introduction to linux os
 
Петро Коренєв, "Presentation state containers"
Петро Коренєв, "Presentation state containers"Петро Коренєв, "Presentation state containers"
Петро Коренєв, "Presentation state containers"
 
Controller design-pattern-drupal-north-toronto-2018-final
Controller design-pattern-drupal-north-toronto-2018-finalController design-pattern-drupal-north-toronto-2018-final
Controller design-pattern-drupal-north-toronto-2018-final
 
Turbo Charge Software Development with Xsemble
Turbo Charge Software Development with XsembleTurbo Charge Software Development with Xsemble
Turbo Charge Software Development with Xsemble
 
Leveraging Open Standards to Build Highly Extensible Autonomous Systems
Leveraging Open Standards to Build Highly Extensible Autonomous SystemsLeveraging Open Standards to Build Highly Extensible Autonomous Systems
Leveraging Open Standards to Build Highly Extensible Autonomous Systems
 
GitOps for Helm Users by Scott Rigby
GitOps for Helm Users by Scott RigbyGitOps for Helm Users by Scott Rigby
GitOps for Helm Users by Scott Rigby
 
Plan a successful enterprise Linux migration
Plan a successful enterprise Linux migrationPlan a successful enterprise Linux migration
Plan a successful enterprise Linux migration
 
Cuashi2008revisited
Cuashi2008revisitedCuashi2008revisited
Cuashi2008revisited
 
Android Interview Questions And Answers | Android Tutorial | Android Online T...
Android Interview Questions And Answers | Android Tutorial | Android Online T...Android Interview Questions And Answers | Android Tutorial | Android Online T...
Android Interview Questions And Answers | Android Tutorial | Android Online T...
 
First Line Of Defense: How contractors can become software factories to suppo...
First Line Of Defense: How contractors can become software factories to suppo...First Line Of Defense: How contractors can become software factories to suppo...
First Line Of Defense: How contractors can become software factories to suppo...
 

Mais de Russel Winder

Mais de Russel Winder (20)

On the Architectures of Microservices: the next layer
On the Architectures of Microservices: the next layerOn the Architectures of Microservices: the next layer
On the Architectures of Microservices: the next layer
 
Fast Python? Don't Bother
Fast Python? Don't BotherFast Python? Don't Bother
Fast Python? Don't Bother
 
Making Python computations fast
Making Python computations fastMaking Python computations fast
Making Python computations fast
 
Tales from the Workshops
Tales from the WorkshopsTales from the Workshops
Tales from the Workshops
 
Making Computations Execute Very Quickly
Making Computations Execute Very QuicklyMaking Computations Execute Very Quickly
Making Computations Execute Very Quickly
 
Java is Dead, Long Live Ceylon, Kotlin, etc
Java is Dead,  Long Live Ceylon, Kotlin, etcJava is Dead,  Long Live Ceylon, Kotlin, etc
Java is Dead, Long Live Ceylon, Kotlin, etc
 
GPars Remoting
GPars RemotingGPars Remoting
GPars Remoting
 
Java is dead, long live Scala, Kotlin, Ceylon, etc.
Java is dead, long live Scala, Kotlin, Ceylon, etc.Java is dead, long live Scala, Kotlin, Ceylon, etc.
Java is dead, long live Scala, Kotlin, Ceylon, etc.
 
Spocktacular testing
Spocktacular testingSpocktacular testing
Spocktacular testing
 
Spocktacular Testing
Spocktacular TestingSpocktacular Testing
Spocktacular Testing
 
Is Groovy static or dynamic
Is Groovy static or dynamicIs Groovy static or dynamic
Is Groovy static or dynamic
 
Java is dead, long live Scala Kotlin Ceylon etc.
Java is dead, long live Scala Kotlin Ceylon etc.Java is dead, long live Scala Kotlin Ceylon etc.
Java is dead, long live Scala Kotlin Ceylon etc.
 
Dataflow: the concurrency/parallelism architecture you need
Dataflow: the concurrency/parallelism architecture you needDataflow: the concurrency/parallelism architecture you need
Dataflow: the concurrency/parallelism architecture you need
 
Are Go and D threats to Python
Are Go and D threats to PythonAre Go and D threats to Python
Are Go and D threats to Python
 
Is Groovy as fast as Java
Is Groovy as fast as JavaIs Groovy as fast as Java
Is Groovy as fast as Java
 
Who needs C++ when you have D and Go
Who needs C++ when you have D and GoWho needs C++ when you have D and Go
Who needs C++ when you have D and Go
 
Java 8: a New Beginning
Java 8: a New BeginningJava 8: a New Beginning
Java 8: a New Beginning
 
Why Go is an important programming language
Why Go is an important programming languageWhy Go is an important programming language
Why Go is an important programming language
 
GPars: Groovy Parallelism for Java
GPars: Groovy Parallelism for JavaGPars: Groovy Parallelism for Java
GPars: Groovy Parallelism for Java
 
GroovyFX: or how to program JavaFX easily
GroovyFX: or how to program JavaFX easily GroovyFX: or how to program JavaFX easily
GroovyFX: or how to program JavaFX easily
 

Último

%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
masabamasaba
 
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
masabamasaba
 
%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...
%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...
%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...
masabamasaba
 
Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024
Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024
Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024
VictoriaMetrics
 

Último (20)

Software Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsSoftware Quality Assurance Interview Questions
Software Quality Assurance Interview Questions
 
WSO2CON 2024 - Cloud Native Middleware: Domain-Driven Design, Cell-Based Arch...
WSO2CON 2024 - Cloud Native Middleware: Domain-Driven Design, Cell-Based Arch...WSO2CON 2024 - Cloud Native Middleware: Domain-Driven Design, Cell-Based Arch...
WSO2CON 2024 - Cloud Native Middleware: Domain-Driven Design, Cell-Based Arch...
 
Announcing Codolex 2.0 from GDK Software
Announcing Codolex 2.0 from GDK SoftwareAnnouncing Codolex 2.0 from GDK Software
Announcing Codolex 2.0 from GDK Software
 
8257 interfacing 2 in microprocessor for btech students
8257 interfacing 2 in microprocessor for btech students8257 interfacing 2 in microprocessor for btech students
8257 interfacing 2 in microprocessor for btech students
 
Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...
Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...
Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...
 
Direct Style Effect Systems - The Print[A] Example - A Comprehension Aid
Direct Style Effect Systems -The Print[A] Example- A Comprehension AidDirect Style Effect Systems -The Print[A] Example- A Comprehension Aid
Direct Style Effect Systems - The Print[A] Example - A Comprehension Aid
 
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
 
Payment Gateway Testing Simplified_ A Step-by-Step Guide for Beginners.pdf
Payment Gateway Testing Simplified_ A Step-by-Step Guide for Beginners.pdfPayment Gateway Testing Simplified_ A Step-by-Step Guide for Beginners.pdf
Payment Gateway Testing Simplified_ A Step-by-Step Guide for Beginners.pdf
 
WSO2Con2024 - Enabling Transactional System's Exponential Growth With Simplicity
WSO2Con2024 - Enabling Transactional System's Exponential Growth With SimplicityWSO2Con2024 - Enabling Transactional System's Exponential Growth With Simplicity
WSO2Con2024 - Enabling Transactional System's Exponential Growth With Simplicity
 
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
 
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
 
%in Hazyview+277-882-255-28 abortion pills for sale in Hazyview
%in Hazyview+277-882-255-28 abortion pills for sale in Hazyview%in Hazyview+277-882-255-28 abortion pills for sale in Hazyview
%in Hazyview+277-882-255-28 abortion pills for sale in Hazyview
 
%in kempton park+277-882-255-28 abortion pills for sale in kempton park
%in kempton park+277-882-255-28 abortion pills for sale in kempton park %in kempton park+277-882-255-28 abortion pills for sale in kempton park
%in kempton park+277-882-255-28 abortion pills for sale in kempton park
 
Harnessing ChatGPT - Elevating Productivity in Today's Agile Environment
Harnessing ChatGPT  - Elevating Productivity in Today's Agile EnvironmentHarnessing ChatGPT  - Elevating Productivity in Today's Agile Environment
Harnessing ChatGPT - Elevating Productivity in Today's Agile Environment
 
%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...
%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...
%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...
 
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
 
tonesoftg
tonesoftgtonesoftg
tonesoftg
 
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
 
Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024
Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024
Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024
 
WSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital Transformation
WSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital TransformationWSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital Transformation
WSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital Transformation
 

On Concurrency and Parallelism in the JVMverse

  • 1. Copyright © 2018 Russel Winder 1 On Concurrency and Parallelism in the JVMVerse Russel Winder @russel_winder russel@winder.org.uk https://www.russel.org.uk
  • 2. Copyright © 2018 Russel Winder 2 The Presenter ● Ex theoretical physicist ● Ex UNIX systems programmer ● Ex academic: – Parallel programming – Software development and programming – HCI, UI, UX ● Ex Company director ● Ex Independent consultant ● Ex analyst ● Ex author ● Ex expert witness ● Ex trainer Russel Winder
  • 3. Copyright © 2018 Russel Winder 3 Me at Previous JAXLondons ● 2011 ”Just Keep Passing the Messages” ● 2012 ”it’S All About Processes Communicating” Also many sessions at other conferences
  • 4. Copyright © 2018 Russel Winder 4 Concurrency ● dictionary.com – concurrence – the act of concurring. – accordance in opinion; agreement: With the concurrence of several specialists, our doctor recommended surgery. – cooperation, as of agents or causes; combined action or effort. ● Wikipedia – concurrency – In computer science, concurrency refers to the ability of different parts or units of a program, algorithm, or problem to be executed out-of-order or in partial order, without affecting the final outcome.
  • 5. Copyright © 2018 Russel Winder 5 Parallelism ● dictionary.com – parallelism – the position or relation of parallels. – agreement in direction, tendency, or character; the state or condition of being parallel. – a parallel or comparison. ● Wikipedia – parallelism – Parallel computing is a type of computation in which many calculations or the execution of processes are carried out simultaneously.
  • 6. Copyright © 2018 Russel Winder 6 Original computing: single CPU, single program
  • 7. Copyright © 2018 Russel Winder 7 Multitasking: single CPU, many programs
  • 8. Copyright © 2018 Russel Winder 8 Five programs, one CPU
  • 9. Copyright © 2018 Russel Winder 9 OS manages all the programs in one memory, eventually get virtual memory, in the mean time locks, semaphores, monitors, mutexes, and the theory of concurrency get invented.
  • 10. Copyright © 2018 Russel Winder 10 Five programs, one CPU
  • 11. Copyright © 2018 Russel Winder 11 Five programs, four CPUs
  • 12. Copyright © 2018 Russel Winder 12 Moving from operating systems to applications
  • 13. Copyright © 2018 Russel Winder 13 One program, one task, one CPU
  • 14. Copyright © 2018 Russel Winder 14 One program, four tasks, one CPU
  • 15. Copyright © 2018 Russel Winder 15 One program, four tasks, four CPUs
  • 16. Copyright © 2018 Russel Winder 16 One program, four tasks, four CPUs
  • 17. Copyright © 2018 Russel Winder 17 Locks, mutexes, sempahores, monitors are the enemy of parallelism
  • 18. Copyright © 2018 Russel Winder 18 What is the problem…
  • 19. Copyright © 2018 Russel Winder 19 Shared Memory
  • 20. Copyright © 2018 Russel Winder 20 A Bit of Java History ● 1995 — Java introduces threads, multithreading, monitors, synchronized, locks, etc. ● 1996 — People predict lots of tears and grief. ● 2002 —Doug Lea gets JSR166 moving. ● 2011 — Fork/Join framework in Java 7.
  • 21. Copyright © 2018 Russel Winder 21 A Bit More Java History ● 2014 — Java 8 introduces: – Lambda Expressions, – Streams, and – CompletableFuture.
  • 22. Copyright © 2018 Russel Winder 22 Abstract code away from the details of managing concurrency and parallelism.
  • 23. Copyright © 2018 Russel Winder 23
  • 24. Copyright © 2018 Russel Winder 24 Pipeline
  • 25. Copyright © 2018 Russel Winder 25 Dataflow
  • 26. Copyright © 2018 Russel Winder 26 Actors
  • 27. Copyright © 2018 Russel Winder 27 Distributed System
  • 28. Copyright © 2018 Russel Winder 28 Microservices
  • 29. Copyright © 2018 Russel Winder 29 Independent processes/tasks/programs communicating by message passing
  • 30. Copyright © 2018 Russel Winder 30 Data Parallel
  • 31. Copyright © 2018 Russel Winder 31 Event Processing
  • 32. Copyright © 2018 Russel Winder 32 One program, four tasks
  • 33. Copyright © 2018 Russel Winder 33 Have we seen the code yet?
  • 34. Copyright © 2018 Russel Winder 34 Summary ● Gpars (Groovy) ● Quasar ● Kotlin Coroutines Can Java catch up (again).
  • 35. Copyright © 2018 Russel Winder 35 On Concurrency and Parallelism in the JVMVerse Russel Winder @russel_winder russel@winder.org.uk https://www.russel.org.uk