SlideShare une entreprise Scribd logo
1  sur  49
Télécharger pour lire hors ligne
More Than Java
 Concurrency
                             Darren.Wang(   强)




Thursday, January 20, 2011
Agenda

                      More Than Java Concurrency? What’s More?

                      Several Concurrency Models/Patterns

                      Case Study

                      Questions?

                      The end



Thursday, January 20, 2011
Why concurrency?




Thursday, January 20, 2011
What concurrency
                offers
                      reduce latency

                             divide and conquer, run in parallel reduce
                             the latency

                      hide latency

                             asynchronous

                      increase throughput

                             more tasks can be run without wasting
                             available computing power
Thursday, January 20, 2011
What we do with
                Java Concurrency


                        State             , That’s all of the about.

                             Atomicity - keep state intact

                             Visibility - make right state access




Thursday, January 20, 2011
When Things Go
      Wrong




Thursday, January 20, 2011
What If ...




Thursday, January 20, 2011
What We Will Talk
                Today

                      Share-State Concurrency

                      Share-Nothing Concurrency

                      Software Transaction Memory

                      Data-Flow Concurrency




Thursday, January 20, 2011
Share-State
                             Concurrency




Thursday, January 20, 2011
JMM Simplified




                                     Picture borrowed from <<Java   >>
Thursday, January 20, 2011
JMM escalation




Thursday, January 20, 2011
How to deal with?



                      How many ways can you count?

                      Here we go...




Thursday, January 20, 2011
Immutability

                      immutable anytime

                             Immutable Object

                      immutable before publishing

                             Map & ConcurrencyMap


                                   (1)To Find More in book <<Java Concurrency In Practice>>




Thursday, January 20, 2011
Confinement


                      Thread Confinement

                             Thread-Specific Variables(ThreadLocal)

                      Stack Confinement

                             Method Stack Scope




Thursday, January 20, 2011
Synchronization


                      Synchronized Block(Implicit Lock)

                      Explicit Lock

                      Volatile (Partial Synchronization Support)




Thursday, January 20, 2011
Gotchas With
                             Synchronization
                      Deadlock

                             how to prevent it?




                      Live lock

                      Starvation


Thursday, January 20, 2011
Gotchas With
                             Synchronization
                      Deadlock

                             how to prevent it?

                              Resource Re-ordering



                      Live lock

                      Starvation


Thursday, January 20, 2011
Gotchas With
                             Synchronization
                      Deadlock

                             how to prevent it?

                              Resource Re-ordering
                              Periodic Retry

                      Live lock

                      Starvation


Thursday, January 20, 2011
Performance Tuning
                with Synchronization


                      reduce the time of holding locks

                             break global locks into fine-grained locks

                      what coming next?




Thursday, January 20, 2011
CAS

                      Compare-And-Set | Compare-And-Swap

                      java.util.concurrent.atomic after Java5

                             AtomicInteger

                             AtomicLong

                             AtomicBoolean

                             AtomicReference


Thursday, January 20, 2011
Section Conclusion


                      Pessimistic Model

                             Lock-Based

                      Optimistic Model

                             Lock-Free




Thursday, January 20, 2011
Share-Nothing
                              Concurrency




Thursday, January 20, 2011
Share-Nothing
                              Concurrency


                      AKA. Message Passing Concurrency

                      Confinement In a Big Picture




Thursday, January 20, 2011
Actor Model
                      First proposed by Carl Hewitt in 1973

                      improved by Gul Agha

                      An Actor Can:

                             change internal state

                             send messages to peer actors

                             create new actors

                             migrate to another computing host

Thursday, January 20, 2011
Actor Rocks

                      more light weight

                             event based actors of akka can create
                             6.5million on 4 G RAM (600 bytes each)

                      much easier, just send messages

                             counter ! tick




Thursday, January 20, 2011
Actors Available
                      Erlang Platform

                      Scala Platform

                             TBA, EBA

                             Lift Actor, Akka Actor

                      Java Platform

                             Kilim, SALSA(simple actor language, system
                             and architecture)

                      Other
Thursday, January 20, 2011
Actor Almighty?

                      when we really have shared states, e.g. bank
                      account?

                      when we need to form unified consensus

                      when we need synchronous behavior

                      a bit verbose compared to method dispatch




Thursday, January 20, 2011
Section Conclusion


                      Actor Model Rocks In Some Situations, But not
                      all

                      Share Nothing Simplify the Architecture Design

                      Prefer Share Nothing to Share State If Possible




Thursday, January 20, 2011
You Know Lego,
                Right?




Thursday, January 20, 2011
Case Study I

                      Session Management

                             Centralized Storage

                                memcached, database...

                             Client-Specific Storage

                                secure cookie

                                other local-storage mechanism


Thursday, January 20, 2011
Case Study II


                      Map-Reduce

                             When Share Nothing can rock in

                             When Share State Is a Must




Thursday, January 20, 2011
Case Study III


                      Symmetric Cluster

                             Share Nothing

                      Asymmetric Cluster

                             Share State




Thursday, January 20, 2011
STM


                      Software Transaction Memory

                      Transaction operations execute in the own
                      thread in parallel, commit will cause One to be
                      successful and others to abort or retry




Thursday, January 20, 2011
Sounds Familiar?


                      Optimistic Model

                      Can be nested

                      Simple Programming Model




Thursday, January 20, 2011
Available Solutions


                      Clojure

                      Concurrent Haskell

                      STM .Net

                      More...




Thursday, January 20, 2011
Cons

                      All operations in scope of a transaction:

                             need to be idempotent

                             can’t have side-effects

                      Memory Concern

                      Conflicting Rate Concern



Thursday, January 20, 2011
Section Conclusion


                      optimistic model

                      simple programming model

                      with restrictions

                             which may cause limitations(MS drops STM)




Thursday, January 20, 2011
Data-Flow
    Concurrency



                      AKA. Declarative Concurrency




Thursday, January 20, 2011
Have you ever...




Thursday, January 20, 2011
Features


                      Single Assignment Variables

                      Data-States trigger process flow




Thursday, January 20, 2011
Available
                Languages



                      LabView




Thursday, January 20, 2011
Usage Scenarios



                      Signal Process System




Thursday, January 20, 2011
Typical Operations


                      create a data-flow variable

                      wait for the variable to be bound

                      bind the variable




Thursday, January 20, 2011
Limitations


                      Can’t have side-effects

                             Exceptions

                             IO

                             Others




Thursday, January 20, 2011
Section Conclusion



                      Data Based Concurrency




Thursday, January 20, 2011
comparison of
                         common facilities

                      Executor (Agent)

                      Actor (HawtDispatch)

                      STM

                      Transactor(Actor + STM)




Thursday, January 20, 2011
Thursday, January 20, 2011
Thank You




Thursday, January 20, 2011
The End




Thursday, January 20, 2011

Contenu connexe

En vedette

Proof and Emacs
Proof and EmacsProof and Emacs
Proof and Emacsdico_leque
 
モナドをつくろう
モナドをつくろうモナドをつくろう
モナドをつくろうdico_leque
 
Continuations in scala (incomplete version)
Continuations in scala (incomplete version)Continuations in scala (incomplete version)
Continuations in scala (incomplete version)Fuqiang Wang
 
Legend of Java Concurrency/Parallelism
Legend of Java Concurrency/ParallelismLegend of Java Concurrency/Parallelism
Legend of Java Concurrency/ParallelismYuichi Sakuraba
 
Zookeeper In Simple Words
Zookeeper In Simple WordsZookeeper In Simple Words
Zookeeper In Simple WordsFuqiang Wang
 
Effective java - concurrency
Effective java - concurrencyEffective java - concurrency
Effective java - concurrencyfeng lee
 
[Java concurrency]01.thread management
[Java concurrency]01.thread management[Java concurrency]01.thread management
[Java concurrency]01.thread managementxuehan zhu
 
Java concurrency
Java concurrencyJava concurrency
Java concurrencyducquoc_vn
 
Java Concurrency Gotchas
Java Concurrency GotchasJava Concurrency Gotchas
Java Concurrency GotchasAlex Miller
 
Java Concurrency, Memory Model, and Trends
Java Concurrency, Memory Model, and TrendsJava Concurrency, Memory Model, and Trends
Java Concurrency, Memory Model, and TrendsCarol McDonald
 
Java Course 10: Threads and Concurrency
Java Course 10: Threads and ConcurrencyJava Course 10: Threads and Concurrency
Java Course 10: Threads and ConcurrencyAnton Keks
 
Working With Concurrency In Java 8
Working With Concurrency In Java 8Working With Concurrency In Java 8
Working With Concurrency In Java 8Heartin Jacob
 
Java Concurrency in Practice
Java Concurrency in PracticeJava Concurrency in Practice
Java Concurrency in PracticeAlina Dolgikh
 
Java concurrency in practice
Java concurrency in practiceJava concurrency in practice
Java concurrency in practiceMikalai Alimenkou
 
Multithreading In Java
Multithreading In JavaMultithreading In Java
Multithreading In Javaparag
 
Multithreading in java
Multithreading in javaMultithreading in java
Multithreading in javaRaghu nath
 
Java multi threading
Java multi threadingJava multi threading
Java multi threadingRaja Sekhar
 
Concurrency in Java
Concurrency in  JavaConcurrency in  Java
Concurrency in JavaAllan Huang
 

En vedette (19)

Proof and Emacs
Proof and EmacsProof and Emacs
Proof and Emacs
 
モナドをつくろう
モナドをつくろうモナドをつくろう
モナドをつくろう
 
Continuations in scala (incomplete version)
Continuations in scala (incomplete version)Continuations in scala (incomplete version)
Continuations in scala (incomplete version)
 
Java Concurrency
Java ConcurrencyJava Concurrency
Java Concurrency
 
Legend of Java Concurrency/Parallelism
Legend of Java Concurrency/ParallelismLegend of Java Concurrency/Parallelism
Legend of Java Concurrency/Parallelism
 
Zookeeper In Simple Words
Zookeeper In Simple WordsZookeeper In Simple Words
Zookeeper In Simple Words
 
Effective java - concurrency
Effective java - concurrencyEffective java - concurrency
Effective java - concurrency
 
[Java concurrency]01.thread management
[Java concurrency]01.thread management[Java concurrency]01.thread management
[Java concurrency]01.thread management
 
Java concurrency
Java concurrencyJava concurrency
Java concurrency
 
Java Concurrency Gotchas
Java Concurrency GotchasJava Concurrency Gotchas
Java Concurrency Gotchas
 
Java Concurrency, Memory Model, and Trends
Java Concurrency, Memory Model, and TrendsJava Concurrency, Memory Model, and Trends
Java Concurrency, Memory Model, and Trends
 
Java Course 10: Threads and Concurrency
Java Course 10: Threads and ConcurrencyJava Course 10: Threads and Concurrency
Java Course 10: Threads and Concurrency
 
Working With Concurrency In Java 8
Working With Concurrency In Java 8Working With Concurrency In Java 8
Working With Concurrency In Java 8
 
Java Concurrency in Practice
Java Concurrency in PracticeJava Concurrency in Practice
Java Concurrency in Practice
 
Java concurrency in practice
Java concurrency in practiceJava concurrency in practice
Java concurrency in practice
 
Multithreading In Java
Multithreading In JavaMultithreading In Java
Multithreading In Java
 
Multithreading in java
Multithreading in javaMultithreading in java
Multithreading in java
 
Java multi threading
Java multi threadingJava multi threading
Java multi threading
 
Concurrency in Java
Concurrency in  JavaConcurrency in  Java
Concurrency in Java
 

Dernier

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
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreternaman860154
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘RTylerCroy
 
[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
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking MenDelhi Call girls
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?Igalia
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CVKhem
 
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
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountPuma Security, LLC
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slidespraypatel2
 
Advantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessAdvantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessPixlogix Infotech
 
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
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024The Digital Insurer
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Miguel Araújo
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking MenDelhi Call girls
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024Results
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEarley Information Science
 
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
 
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
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfEnterprise Knowledge
 

Dernier (20)

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
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
[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
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 
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)
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path Mount
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slides
 
Advantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessAdvantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your Business
 
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
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
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...
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
 

More Than Java Concurrency

  • 1. More Than Java Concurrency Darren.Wang( 强) Thursday, January 20, 2011
  • 2. Agenda More Than Java Concurrency? What’s More? Several Concurrency Models/Patterns Case Study Questions? The end Thursday, January 20, 2011
  • 4. What concurrency offers reduce latency divide and conquer, run in parallel reduce the latency hide latency asynchronous increase throughput more tasks can be run without wasting available computing power Thursday, January 20, 2011
  • 5. What we do with Java Concurrency State , That’s all of the about. Atomicity - keep state intact Visibility - make right state access Thursday, January 20, 2011
  • 6. When Things Go Wrong Thursday, January 20, 2011
  • 7. What If ... Thursday, January 20, 2011
  • 8. What We Will Talk Today Share-State Concurrency Share-Nothing Concurrency Software Transaction Memory Data-Flow Concurrency Thursday, January 20, 2011
  • 9. Share-State Concurrency Thursday, January 20, 2011
  • 10. JMM Simplified Picture borrowed from <<Java >> Thursday, January 20, 2011
  • 12. How to deal with? How many ways can you count? Here we go... Thursday, January 20, 2011
  • 13. Immutability immutable anytime Immutable Object immutable before publishing Map & ConcurrencyMap (1)To Find More in book <<Java Concurrency In Practice>> Thursday, January 20, 2011
  • 14. Confinement Thread Confinement Thread-Specific Variables(ThreadLocal) Stack Confinement Method Stack Scope Thursday, January 20, 2011
  • 15. Synchronization Synchronized Block(Implicit Lock) Explicit Lock Volatile (Partial Synchronization Support) Thursday, January 20, 2011
  • 16. Gotchas With Synchronization Deadlock how to prevent it? Live lock Starvation Thursday, January 20, 2011
  • 17. Gotchas With Synchronization Deadlock how to prevent it? Resource Re-ordering Live lock Starvation Thursday, January 20, 2011
  • 18. Gotchas With Synchronization Deadlock how to prevent it? Resource Re-ordering Periodic Retry Live lock Starvation Thursday, January 20, 2011
  • 19. Performance Tuning with Synchronization reduce the time of holding locks break global locks into fine-grained locks what coming next? Thursday, January 20, 2011
  • 20. CAS Compare-And-Set | Compare-And-Swap java.util.concurrent.atomic after Java5 AtomicInteger AtomicLong AtomicBoolean AtomicReference Thursday, January 20, 2011
  • 21. Section Conclusion Pessimistic Model Lock-Based Optimistic Model Lock-Free Thursday, January 20, 2011
  • 22. Share-Nothing Concurrency Thursday, January 20, 2011
  • 23. Share-Nothing Concurrency AKA. Message Passing Concurrency Confinement In a Big Picture Thursday, January 20, 2011
  • 24. Actor Model First proposed by Carl Hewitt in 1973 improved by Gul Agha An Actor Can: change internal state send messages to peer actors create new actors migrate to another computing host Thursday, January 20, 2011
  • 25. Actor Rocks more light weight event based actors of akka can create 6.5million on 4 G RAM (600 bytes each) much easier, just send messages counter ! tick Thursday, January 20, 2011
  • 26. Actors Available Erlang Platform Scala Platform TBA, EBA Lift Actor, Akka Actor Java Platform Kilim, SALSA(simple actor language, system and architecture) Other Thursday, January 20, 2011
  • 27. Actor Almighty? when we really have shared states, e.g. bank account? when we need to form unified consensus when we need synchronous behavior a bit verbose compared to method dispatch Thursday, January 20, 2011
  • 28. Section Conclusion Actor Model Rocks In Some Situations, But not all Share Nothing Simplify the Architecture Design Prefer Share Nothing to Share State If Possible Thursday, January 20, 2011
  • 29. You Know Lego, Right? Thursday, January 20, 2011
  • 30. Case Study I Session Management Centralized Storage memcached, database... Client-Specific Storage secure cookie other local-storage mechanism Thursday, January 20, 2011
  • 31. Case Study II Map-Reduce When Share Nothing can rock in When Share State Is a Must Thursday, January 20, 2011
  • 32. Case Study III Symmetric Cluster Share Nothing Asymmetric Cluster Share State Thursday, January 20, 2011
  • 33. STM Software Transaction Memory Transaction operations execute in the own thread in parallel, commit will cause One to be successful and others to abort or retry Thursday, January 20, 2011
  • 34. Sounds Familiar? Optimistic Model Can be nested Simple Programming Model Thursday, January 20, 2011
  • 35. Available Solutions Clojure Concurrent Haskell STM .Net More... Thursday, January 20, 2011
  • 36. Cons All operations in scope of a transaction: need to be idempotent can’t have side-effects Memory Concern Conflicting Rate Concern Thursday, January 20, 2011
  • 37. Section Conclusion optimistic model simple programming model with restrictions which may cause limitations(MS drops STM) Thursday, January 20, 2011
  • 38. Data-Flow Concurrency AKA. Declarative Concurrency Thursday, January 20, 2011
  • 39. Have you ever... Thursday, January 20, 2011
  • 40. Features Single Assignment Variables Data-States trigger process flow Thursday, January 20, 2011
  • 41. Available Languages LabView Thursday, January 20, 2011
  • 42. Usage Scenarios Signal Process System Thursday, January 20, 2011
  • 43. Typical Operations create a data-flow variable wait for the variable to be bound bind the variable Thursday, January 20, 2011
  • 44. Limitations Can’t have side-effects Exceptions IO Others Thursday, January 20, 2011
  • 45. Section Conclusion Data Based Concurrency Thursday, January 20, 2011
  • 46. comparison of common facilities Executor (Agent) Actor (HawtDispatch) STM Transactor(Actor + STM) Thursday, January 20, 2011