SlideShare ist ein Scribd-Unternehmen logo
1 von 42
Downloaden Sie, um offline zu lesen
actors
a unifying design pattern
for scalable concurrency

       www.iolanguage.com
       steve@dekorte.com
talk overview
    what is an actor?

  concurrency trends

 problems and solutions

     the big picture
what is an actor?
             an informal definition

      an object with an asynchronous
message queue and an execution context for
          processing that queue

encapsulates state, instructions and execution

       (a CSP is a process level actor)
concurrency trends
      a quick look
clock speed
                 leveling off

                                          5,000 ?
                                4,000 ?


                       2,000

               800
       120
50
1990    1995    2000     2005      2010      2015
cores per machine
        increasing exponentially
                                   80 ?




                        24 ?
                 8
         4
2

2002    2004    2006    2008       2011
clusters
         massive scaling

                      typical scale
memcached                  10^2
   gfs                     10^4
  mmog                     10^3
   p2p                     10^5
 @home                     10^6
trends are
   cores and clusters

   ideal concurrency model
will naturally scale across both
traditional concurrency model

      preemptive threads with
        shared memory and
       coordination via locks
problem
nondeterminism
For concurrent programming to become
mainstream, we must discard threads as a
         programming model.


Nondeterminism should be judiciously and
carefully introduced where needed, and it
     should be explicit in programs.


- Ed Lee, The Problem with Threads
      Berkeley CS Tech Report
traditional concurrency model
threads can directly change one another’s state
           “spaghetti concurrency”

             thread A      thread B
actor/csp model
only a thread can directly change it’s own state

           thread A          thread B

            queue             queue




     same model works across machines
a natural extension
         actors are the object
    paradigm extended to execution

objects encapsulate state and instructions

  actors encapsulate state, instructions
             and execution
what this looks like in Io
     any object becomes an actor when
           sent an async message

account deposit(10.00) // sync message

account @deposit(10.00) // future message

account @@deposit(10.00) // async message

        Io is a hybrid actor language
problem
asynchronous
programming
a future

 an object returned from an async message
    which becomes the result when it is
available. If it is accessed before the result is
     ready, it blocks the calling execution
                      context.
futures

sync programming with async messages by
 decoupling messages from return values

     allows lazy synchronization and
      automatic deadlock detection
another look

account deposit(10.00) // sync message

account @deposit(10.00) // future message

account @@deposit(10.00) // async message
another example

// waits for result
data := url fetch

// returns a future immediately
data := url @fetch

data setFutureDelegate(self)
the undiscovered country
lots of interesting concurrent coordinating
patterns can be composed from futures or
   other forms of async return messages

c   := urls cursor
c   setConcurrency(500)
c   setDelegate(self)
c   foreach(fetch)
problem
distributed programming
transparent distributed objects
  unified local and remote messaging

peers append(DO at(ip, port, key))
...
c := peers cursor
c setConcurrency(50)
c setDelegate(self)
c foreach(search(query))

       eliminates protocol hassles but
doesn’t mean we can ignore the network, etc
problem
the high concurrency
 memory bottleneck
execution contexts
    memory usage and maximum concurrency

                          bytes          max per GB

process/os thread      1,000,000s            100s*

  stackfull coro        10,000s            10,000s
stackless coro or         100s          1,000,000s**
   continuation
              *webkit etc use os threads..
    **but thread related state may exceed stack size
synonyms            synonyms

 user level thread     os thread
lightweight thread   kernel thread
    microthread      native thread
   green thread
     coroutine
       coro
       fiber
taxonomy
             execution context / thread


                                user level thread
    os thread
 large fixed stack size
   nondeterministic
hw registers swapping
                            coroutine        continuation
                                          linked activation records


             stackfull coro              stackless coro
          small fixed stack size          variable stack size
   deterministic hw registers swapping
what this means in practice




          connections
user level threads aren’t
preemptive, so what about
       blocking ops?

     avoid them by using
      async sockets and
         async file i/o
async issues
         ease of use?
pause the user level thread while
waiting on the async i/o request

    cpu bound blocking?
use explicit yield() where needed
conclusion

use user level threads for scaling
concurrency on a given core and
one os threads or processes per
  core for scaling across cores
the big picture
            “powers of 10”

     each level follows the actor pattern of
encapsulating state, instructions and execution and
   communicating via async queued messaging
actor
user thread
actor         actor   actor
actor


                csp
        actor         actor   actor
actor
           os process
        actor         actor   actor
actor

        actor         actor   actor
actor
csp   csp   csp
csp

      csp   csp   csp
csp
      machine
      csp   csp   csp
csp

      csp   csp   csp
csp
machine   machine   machine
machine

          machine   machine   machine
machine
            cluster
          machine   machine   machine
machine

          machine   machine   machine
machine
some fun speculation
 what about cores?
a prediction based on this pattern
traditional SISD architecture
works, but clock speed growth is slowing
           and silicon is cheap



                  core

                  bus

                memory
current MISD architecture
bus bottleneck - memory performance per core
         drops as core count increases



              core         core

                     bus

                  memory
future MIMD architecture?
  the actor pattern on the hardware level
      a connection machine on a chip

              core

 SISD       SISD                     SISD   SI
                         SISD
             memory




 SISD       SISD         SISD        SISD   SI



 SISD       SISD         SISD        SISD   SI
automatic MIMD distribution



 SISD          SISD          SISD          SISD         SI
   array




 SISD          SISD          SISD          SISD         SI
array shard   array shard   array shard   array shard




 SISD          SISD          SISD          SISD         SI
this talk, in a nutshell
   solution          problem                solution

  concurrency     nondeterminism            actors/csp

                distributed and async transparent distributed
   actors/csp
                    programming         objects and futures

high concurrency memory bottleneck      user level threads

  many cores       bus bottleneck             MIMD


        www.iolanguage.com     steve@dekorte.com

Weitere ähnliche Inhalte

Was ist angesagt?

Concurrent Programming with Ruby and Tuple Spaces
Concurrent Programming with Ruby and Tuple SpacesConcurrent Programming with Ruby and Tuple Spaces
Concurrent Programming with Ruby and Tuple Spacesluccastera
 
Transformer Zoo (a deeper dive)
Transformer Zoo (a deeper dive)Transformer Zoo (a deeper dive)
Transformer Zoo (a deeper dive)Grigory Sapunov
 
Erlang, random numbers, and the security: London Erlang User Group Talk Slide...
Erlang, random numbers, and the security: London Erlang User Group Talk Slide...Erlang, random numbers, and the security: London Erlang User Group Talk Slide...
Erlang, random numbers, and the security: London Erlang User Group Talk Slide...Kenji Rikitake
 
Sequence learning and modern RNNs
Sequence learning and modern RNNsSequence learning and modern RNNs
Sequence learning and modern RNNsGrigory Sapunov
 
Actors and Threads
Actors and ThreadsActors and Threads
Actors and Threadsmperham
 

Was ist angesagt? (8)

Concurrent Programming with Ruby and Tuple Spaces
Concurrent Programming with Ruby and Tuple SpacesConcurrent Programming with Ruby and Tuple Spaces
Concurrent Programming with Ruby and Tuple Spaces
 
Transformer Zoo (a deeper dive)
Transformer Zoo (a deeper dive)Transformer Zoo (a deeper dive)
Transformer Zoo (a deeper dive)
 
Java under the hood
Java under the hoodJava under the hood
Java under the hood
 
Modular Pick and Place Simulator using ROS Framework
Modular Pick and Place Simulator using ROS FrameworkModular Pick and Place Simulator using ROS Framework
Modular Pick and Place Simulator using ROS Framework
 
Erlang, random numbers, and the security: London Erlang User Group Talk Slide...
Erlang, random numbers, and the security: London Erlang User Group Talk Slide...Erlang, random numbers, and the security: London Erlang User Group Talk Slide...
Erlang, random numbers, and the security: London Erlang User Group Talk Slide...
 
Sequence learning and modern RNNs
Sequence learning and modern RNNsSequence learning and modern RNNs
Sequence learning and modern RNNs
 
Actors and Threads
Actors and ThreadsActors and Threads
Actors and Threads
 
Java concurrency
Java concurrencyJava concurrency
Java concurrency
 

Andere mochten auch

SF Social Media Platform
SF  Social Media PlatformSF  Social Media Platform
SF Social Media PlatformLatte Media
 
What's new In Perl?
What's new In Perl?What's new In Perl?
What's new In Perl?acme
 
Internal communication for a startup
Internal communication for a startupInternal communication for a startup
Internal communication for a startupLuca Sartoni
 
Challenges of educational open data
Challenges of educational open dataChallenges of educational open data
Challenges of educational open dataSimon Grant
 
CAA Portfolio
CAA PortfolioCAA Portfolio
CAA Portfoliobeast
 
Portfolio interoperability progress in the UK
Portfolio interoperability progress in the UKPortfolio interoperability progress in the UK
Portfolio interoperability progress in the UKSimon Grant
 
Lemill
LemillLemill
Lemillterje1
 
Oni nushdautsa v zashite
Oni nushdautsa v zashiteOni nushdautsa v zashite
Oni nushdautsa v zashiteviktoriya71
 
Email Marketing That Works
Email Marketing That WorksEmail Marketing That Works
Email Marketing That WorksJosue Sierra
 
Metaphorical Journey - Vladimir Kush
Metaphorical Journey - Vladimir KushMetaphorical Journey - Vladimir Kush
Metaphorical Journey - Vladimir Kushmariorui
 
Blogging, Activism, and a Christian Worldview
Blogging, Activism, and a Christian Worldview Blogging, Activism, and a Christian Worldview
Blogging, Activism, and a Christian Worldview Josue Sierra
 
Platfrom for community-based solutions
Platfrom for community-based solutionsPlatfrom for community-based solutions
Platfrom for community-based solutionsLatte Media
 
Cumhuriyetin Dusmanlari
Cumhuriyetin DusmanlariCumhuriyetin Dusmanlari
Cumhuriyetin Dusmanlarimillitrk
 
Being connected is the new rock'n roll
Being connected is the new rock'n rollBeing connected is the new rock'n roll
Being connected is the new rock'n rollOyvind Solstad
 
Competency: MedBiquitous and other ideas
Competency: MedBiquitous and other ideasCompetency: MedBiquitous and other ideas
Competency: MedBiquitous and other ideasSimon Grant
 
How It Works The Computer (1971 Edition)
How It Works   The Computer (1971 Edition)How It Works   The Computer (1971 Edition)
How It Works The Computer (1971 Edition)fosk
 

Andere mochten auch (20)

Concurrency Patterns
Concurrency PatternsConcurrency Patterns
Concurrency Patterns
 
SF Social Media Platform
SF  Social Media PlatformSF  Social Media Platform
SF Social Media Platform
 
What's new In Perl?
What's new In Perl?What's new In Perl?
What's new In Perl?
 
Internal communication for a startup
Internal communication for a startupInternal communication for a startup
Internal communication for a startup
 
Challenges of educational open data
Challenges of educational open dataChallenges of educational open data
Challenges of educational open data
 
CAA Portfolio
CAA PortfolioCAA Portfolio
CAA Portfolio
 
Portfolio interoperability progress in the UK
Portfolio interoperability progress in the UKPortfolio interoperability progress in the UK
Portfolio interoperability progress in the UK
 
Tiny
TinyTiny
Tiny
 
Lemill
LemillLemill
Lemill
 
Iglesia de San Antonio
Iglesia de San AntonioIglesia de San Antonio
Iglesia de San Antonio
 
Cases for IPTV
Cases for IPTVCases for IPTV
Cases for IPTV
 
Oni nushdautsa v zashite
Oni nushdautsa v zashiteOni nushdautsa v zashite
Oni nushdautsa v zashite
 
Email Marketing That Works
Email Marketing That WorksEmail Marketing That Works
Email Marketing That Works
 
Metaphorical Journey - Vladimir Kush
Metaphorical Journey - Vladimir KushMetaphorical Journey - Vladimir Kush
Metaphorical Journey - Vladimir Kush
 
Blogging, Activism, and a Christian Worldview
Blogging, Activism, and a Christian Worldview Blogging, Activism, and a Christian Worldview
Blogging, Activism, and a Christian Worldview
 
Platfrom for community-based solutions
Platfrom for community-based solutionsPlatfrom for community-based solutions
Platfrom for community-based solutions
 
Cumhuriyetin Dusmanlari
Cumhuriyetin DusmanlariCumhuriyetin Dusmanlari
Cumhuriyetin Dusmanlari
 
Being connected is the new rock'n roll
Being connected is the new rock'n rollBeing connected is the new rock'n roll
Being connected is the new rock'n roll
 
Competency: MedBiquitous and other ideas
Competency: MedBiquitous and other ideasCompetency: MedBiquitous and other ideas
Competency: MedBiquitous and other ideas
 
How It Works The Computer (1971 Edition)
How It Works   The Computer (1971 Edition)How It Works   The Computer (1971 Edition)
How It Works The Computer (1971 Edition)
 

Ähnlich wie actors as a unifying design pattern for scalable concurrency

Simon Peyton Jones: Managing parallelism
Simon Peyton Jones: Managing parallelismSimon Peyton Jones: Managing parallelism
Simon Peyton Jones: Managing parallelismSkills Matter
 
Peyton jones-2011-parallel haskell-the_future
Peyton jones-2011-parallel haskell-the_futurePeyton jones-2011-parallel haskell-the_future
Peyton jones-2011-parallel haskell-the_futureTakayuki Muranushi
 
How Java 19 Influences the Future of Your High-Scale Applications .pdf
How Java 19 Influences the Future of Your High-Scale Applications .pdfHow Java 19 Influences the Future of Your High-Scale Applications .pdf
How Java 19 Influences the Future of Your High-Scale Applications .pdfAna-Maria Mihalceanu
 
"Source Code Abstracts Classification Using CNN", Vadim Markovtsev, Lead Soft...
"Source Code Abstracts Classification Using CNN", Vadim Markovtsev, Lead Soft..."Source Code Abstracts Classification Using CNN", Vadim Markovtsev, Lead Soft...
"Source Code Abstracts Classification Using CNN", Vadim Markovtsev, Lead Soft...Dataconomy Media
 
CETH for XDP [Linux Meetup Santa Clara | July 2016]
CETH for XDP [Linux Meetup Santa Clara | July 2016] CETH for XDP [Linux Meetup Santa Clara | July 2016]
CETH for XDP [Linux Meetup Santa Clara | July 2016] IO Visor Project
 
High-Performance Graph Analysis and Modeling
High-Performance Graph Analysis and ModelingHigh-Performance Graph Analysis and Modeling
High-Performance Graph Analysis and ModelingNesreen K. Ahmed
 
Understanding hardware acceleration on mobile browsers presentation
Understanding hardware acceleration on mobile browsers presentationUnderstanding hardware acceleration on mobile browsers presentation
Understanding hardware acceleration on mobile browsers presentationJustin Dorfman
 
Understanding Hardware Acceleration on Mobile Browsers
Understanding Hardware Acceleration on Mobile BrowsersUnderstanding Hardware Acceleration on Mobile Browsers
Understanding Hardware Acceleration on Mobile BrowsersAriya Hidayat
 
OpenStack and OpenFlow Demos
OpenStack and OpenFlow DemosOpenStack and OpenFlow Demos
OpenStack and OpenFlow DemosBrent Salisbury
 
Q con london2011-matthewwall-whyichosemongodbforguardiancouk
Q con london2011-matthewwall-whyichosemongodbforguardiancoukQ con london2011-matthewwall-whyichosemongodbforguardiancouk
Q con london2011-matthewwall-whyichosemongodbforguardiancoukRoger Xia
 
Trip down the GPU lane with Machine Learning
Trip down the GPU lane with Machine LearningTrip down the GPU lane with Machine Learning
Trip down the GPU lane with Machine LearningRenaldas Zioma
 
Beyond The Data Grid: Coherence, Normalisation, Joins and Linear Scalability
Beyond The Data Grid: Coherence, Normalisation, Joins and Linear ScalabilityBeyond The Data Grid: Coherence, Normalisation, Joins and Linear Scalability
Beyond The Data Grid: Coherence, Normalisation, Joins and Linear ScalabilityBen Stopford
 
Design Patterns for Distributed Non-Relational Databases
Design Patterns for Distributed Non-Relational DatabasesDesign Patterns for Distributed Non-Relational Databases
Design Patterns for Distributed Non-Relational Databasesguestdfd1ec
 
Data-Intensive Computing for Competent Genetic Algorithms: A Pilot Study us...
Data-Intensive Computing for  Competent Genetic Algorithms:  A Pilot Study us...Data-Intensive Computing for  Competent Genetic Algorithms:  A Pilot Study us...
Data-Intensive Computing for Competent Genetic Algorithms: A Pilot Study us...Xavier Llorà
 
Oscon keynote: Working hard to keep it simple
Oscon keynote: Working hard to keep it simpleOscon keynote: Working hard to keep it simple
Oscon keynote: Working hard to keep it simpleMartin Odersky
 
Ceph: Open Source Storage Software Optimizations on Intel® Architecture for C...
Ceph: Open Source Storage Software Optimizations on Intel® Architecture for C...Ceph: Open Source Storage Software Optimizations on Intel® Architecture for C...
Ceph: Open Source Storage Software Optimizations on Intel® Architecture for C...Odinot Stanislas
 
Data oriented design and c++
Data oriented design and c++Data oriented design and c++
Data oriented design and c++Mike Acton
 
Millions quotes per second in pure java
Millions quotes per second in pure javaMillions quotes per second in pure java
Millions quotes per second in pure javaRoman Elizarov
 

Ähnlich wie actors as a unifying design pattern for scalable concurrency (20)

Simon Peyton Jones: Managing parallelism
Simon Peyton Jones: Managing parallelismSimon Peyton Jones: Managing parallelism
Simon Peyton Jones: Managing parallelism
 
Peyton jones-2011-parallel haskell-the_future
Peyton jones-2011-parallel haskell-the_futurePeyton jones-2011-parallel haskell-the_future
Peyton jones-2011-parallel haskell-the_future
 
How Java 19 Influences the Future of Your High-Scale Applications .pdf
How Java 19 Influences the Future of Your High-Scale Applications .pdfHow Java 19 Influences the Future of Your High-Scale Applications .pdf
How Java 19 Influences the Future of Your High-Scale Applications .pdf
 
"Source Code Abstracts Classification Using CNN", Vadim Markovtsev, Lead Soft...
"Source Code Abstracts Classification Using CNN", Vadim Markovtsev, Lead Soft..."Source Code Abstracts Classification Using CNN", Vadim Markovtsev, Lead Soft...
"Source Code Abstracts Classification Using CNN", Vadim Markovtsev, Lead Soft...
 
CETH for XDP [Linux Meetup Santa Clara | July 2016]
CETH for XDP [Linux Meetup Santa Clara | July 2016] CETH for XDP [Linux Meetup Santa Clara | July 2016]
CETH for XDP [Linux Meetup Santa Clara | July 2016]
 
High-Performance Graph Analysis and Modeling
High-Performance Graph Analysis and ModelingHigh-Performance Graph Analysis and Modeling
High-Performance Graph Analysis and Modeling
 
Understanding hardware acceleration on mobile browsers presentation
Understanding hardware acceleration on mobile browsers presentationUnderstanding hardware acceleration on mobile browsers presentation
Understanding hardware acceleration on mobile browsers presentation
 
Understanding Hardware Acceleration on Mobile Browsers
Understanding Hardware Acceleration on Mobile BrowsersUnderstanding Hardware Acceleration on Mobile Browsers
Understanding Hardware Acceleration on Mobile Browsers
 
OpenStack and OpenFlow Demos
OpenStack and OpenFlow DemosOpenStack and OpenFlow Demos
OpenStack and OpenFlow Demos
 
Q con london2011-matthewwall-whyichosemongodbforguardiancouk
Q con london2011-matthewwall-whyichosemongodbforguardiancoukQ con london2011-matthewwall-whyichosemongodbforguardiancouk
Q con london2011-matthewwall-whyichosemongodbforguardiancouk
 
Trip down the GPU lane with Machine Learning
Trip down the GPU lane with Machine LearningTrip down the GPU lane with Machine Learning
Trip down the GPU lane with Machine Learning
 
Beyond The Data Grid: Coherence, Normalisation, Joins and Linear Scalability
Beyond The Data Grid: Coherence, Normalisation, Joins and Linear ScalabilityBeyond The Data Grid: Coherence, Normalisation, Joins and Linear Scalability
Beyond The Data Grid: Coherence, Normalisation, Joins and Linear Scalability
 
Design Patterns for Distributed Non-Relational Databases
Design Patterns for Distributed Non-Relational DatabasesDesign Patterns for Distributed Non-Relational Databases
Design Patterns for Distributed Non-Relational Databases
 
Data-Intensive Computing for Competent Genetic Algorithms: A Pilot Study us...
Data-Intensive Computing for  Competent Genetic Algorithms:  A Pilot Study us...Data-Intensive Computing for  Competent Genetic Algorithms:  A Pilot Study us...
Data-Intensive Computing for Competent Genetic Algorithms: A Pilot Study us...
 
Oscon keynote: Working hard to keep it simple
Oscon keynote: Working hard to keep it simpleOscon keynote: Working hard to keep it simple
Oscon keynote: Working hard to keep it simple
 
Ceph: Open Source Storage Software Optimizations on Intel® Architecture for C...
Ceph: Open Source Storage Software Optimizations on Intel® Architecture for C...Ceph: Open Source Storage Software Optimizations on Intel® Architecture for C...
Ceph: Open Source Storage Software Optimizations on Intel® Architecture for C...
 
Ceph
CephCeph
Ceph
 
Data oriented design and c++
Data oriented design and c++Data oriented design and c++
Data oriented design and c++
 
Millions quotes per second in pure java
Millions quotes per second in pure javaMillions quotes per second in pure java
Millions quotes per second in pure java
 
Cisco CCNA Data Center Networking Fundamentals
Cisco CCNA Data Center Networking FundamentalsCisco CCNA Data Center Networking Fundamentals
Cisco CCNA Data Center Networking Fundamentals
 

Kürzlich hochgeladen

Emixa Mendix Meetup 11 April 2024 about Mendix Native development
Emixa Mendix Meetup 11 April 2024 about Mendix Native developmentEmixa Mendix Meetup 11 April 2024 about Mendix Native development
Emixa Mendix Meetup 11 April 2024 about Mendix Native developmentPim van der Noll
 
Connecting the Dots for Information Discovery.pdf
Connecting the Dots for Information Discovery.pdfConnecting the Dots for Information Discovery.pdf
Connecting the Dots for Information Discovery.pdfNeo4j
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity PlanDatabarracks
 
A Framework for Development in the AI Age
A Framework for Development in the AI AgeA Framework for Development in the AI Age
A Framework for Development in the AI AgeCprime
 
Enhancing User Experience - Exploring the Latest Features of Tallyman Axis Lo...
Enhancing User Experience - Exploring the Latest Features of Tallyman Axis Lo...Enhancing User Experience - Exploring the Latest Features of Tallyman Axis Lo...
Enhancing User Experience - Exploring the Latest Features of Tallyman Axis Lo...Scott Andery
 
The State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxThe State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxLoriGlavin3
 
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024BookNet Canada
 
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
 
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxPasskey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxLoriGlavin3
 
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
 
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
 
Modern Roaming for Notes and Nomad – Cheaper Faster Better Stronger
Modern Roaming for Notes and Nomad – Cheaper Faster Better StrongerModern Roaming for Notes and Nomad – Cheaper Faster Better Stronger
Modern Roaming for Notes and Nomad – Cheaper Faster Better Strongerpanagenda
 
What is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdfWhat is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdfMounikaPolabathina
 
TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024Lonnie McRorey
 
Manual 508 Accessibility Compliance Audit
Manual 508 Accessibility Compliance AuditManual 508 Accessibility Compliance Audit
Manual 508 Accessibility Compliance AuditSkynet Technologies
 
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
 
Generative Artificial Intelligence: How generative AI works.pdf
Generative Artificial Intelligence: How generative AI works.pdfGenerative Artificial Intelligence: How generative AI works.pdf
Generative Artificial Intelligence: How generative AI works.pdfIngrid Airi González
 
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
 
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyesHow to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyesThousandEyes
 

Kürzlich hochgeladen (20)

Emixa Mendix Meetup 11 April 2024 about Mendix Native development
Emixa Mendix Meetup 11 April 2024 about Mendix Native developmentEmixa Mendix Meetup 11 April 2024 about Mendix Native development
Emixa Mendix Meetup 11 April 2024 about Mendix Native development
 
Connecting the Dots for Information Discovery.pdf
Connecting the Dots for Information Discovery.pdfConnecting the Dots for Information Discovery.pdf
Connecting the Dots for Information Discovery.pdf
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity Plan
 
A Framework for Development in the AI Age
A Framework for Development in the AI AgeA Framework for Development in the AI Age
A Framework for Development in the AI Age
 
Enhancing User Experience - Exploring the Latest Features of Tallyman Axis Lo...
Enhancing User Experience - Exploring the Latest Features of Tallyman Axis Lo...Enhancing User Experience - Exploring the Latest Features of Tallyman Axis Lo...
Enhancing User Experience - Exploring the Latest Features of Tallyman Axis Lo...
 
The State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxThe State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptx
 
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
 
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
 
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxPasskey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
 
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...
 
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
 
Modern Roaming for Notes and Nomad – Cheaper Faster Better Stronger
Modern Roaming for Notes and Nomad – Cheaper Faster Better StrongerModern Roaming for Notes and Nomad – Cheaper Faster Better Stronger
Modern Roaming for Notes and Nomad – Cheaper Faster Better Stronger
 
What is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdfWhat is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdf
 
TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024
 
Manual 508 Accessibility Compliance Audit
Manual 508 Accessibility Compliance AuditManual 508 Accessibility Compliance Audit
Manual 508 Accessibility Compliance Audit
 
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...
 
Generative Artificial Intelligence: How generative AI works.pdf
Generative Artificial Intelligence: How generative AI works.pdfGenerative Artificial Intelligence: How generative AI works.pdf
Generative Artificial Intelligence: How generative AI works.pdf
 
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
 
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyesHow to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
 

actors as a unifying design pattern for scalable concurrency

  • 1. actors a unifying design pattern for scalable concurrency www.iolanguage.com steve@dekorte.com
  • 2. talk overview what is an actor? concurrency trends problems and solutions the big picture
  • 3. what is an actor? an informal definition an object with an asynchronous message queue and an execution context for processing that queue encapsulates state, instructions and execution (a CSP is a process level actor)
  • 4. concurrency trends a quick look
  • 5. clock speed leveling off 5,000 ? 4,000 ? 2,000 800 120 50 1990 1995 2000 2005 2010 2015
  • 6. cores per machine increasing exponentially 80 ? 24 ? 8 4 2 2002 2004 2006 2008 2011
  • 7. clusters massive scaling typical scale memcached 10^2 gfs 10^4 mmog 10^3 p2p 10^5 @home 10^6
  • 8. trends are cores and clusters ideal concurrency model will naturally scale across both
  • 9. traditional concurrency model preemptive threads with shared memory and coordination via locks
  • 11. For concurrent programming to become mainstream, we must discard threads as a programming model. Nondeterminism should be judiciously and carefully introduced where needed, and it should be explicit in programs. - Ed Lee, The Problem with Threads Berkeley CS Tech Report
  • 12. traditional concurrency model threads can directly change one another’s state “spaghetti concurrency” thread A thread B
  • 13. actor/csp model only a thread can directly change it’s own state thread A thread B queue queue same model works across machines
  • 14. a natural extension actors are the object paradigm extended to execution objects encapsulate state and instructions actors encapsulate state, instructions and execution
  • 15. what this looks like in Io any object becomes an actor when sent an async message account deposit(10.00) // sync message account @deposit(10.00) // future message account @@deposit(10.00) // async message Io is a hybrid actor language
  • 17. a future an object returned from an async message which becomes the result when it is available. If it is accessed before the result is ready, it blocks the calling execution context.
  • 18. futures sync programming with async messages by decoupling messages from return values allows lazy synchronization and automatic deadlock detection
  • 19. another look account deposit(10.00) // sync message account @deposit(10.00) // future message account @@deposit(10.00) // async message
  • 20. another example // waits for result data := url fetch // returns a future immediately data := url @fetch data setFutureDelegate(self)
  • 21. the undiscovered country lots of interesting concurrent coordinating patterns can be composed from futures or other forms of async return messages c := urls cursor c setConcurrency(500) c setDelegate(self) c foreach(fetch)
  • 23. transparent distributed objects unified local and remote messaging peers append(DO at(ip, port, key)) ... c := peers cursor c setConcurrency(50) c setDelegate(self) c foreach(search(query)) eliminates protocol hassles but doesn’t mean we can ignore the network, etc
  • 24. problem the high concurrency memory bottleneck
  • 25. execution contexts memory usage and maximum concurrency bytes max per GB process/os thread 1,000,000s 100s* stackfull coro 10,000s 10,000s stackless coro or 100s 1,000,000s** continuation *webkit etc use os threads.. **but thread related state may exceed stack size
  • 26. synonyms synonyms user level thread os thread lightweight thread kernel thread microthread native thread green thread coroutine coro fiber
  • 27. taxonomy execution context / thread user level thread os thread large fixed stack size nondeterministic hw registers swapping coroutine continuation linked activation records stackfull coro stackless coro small fixed stack size variable stack size deterministic hw registers swapping
  • 28. what this means in practice connections
  • 29. user level threads aren’t preemptive, so what about blocking ops? avoid them by using async sockets and async file i/o
  • 30. async issues ease of use? pause the user level thread while waiting on the async i/o request cpu bound blocking? use explicit yield() where needed
  • 31. conclusion use user level threads for scaling concurrency on a given core and one os threads or processes per core for scaling across cores
  • 32. the big picture “powers of 10” each level follows the actor pattern of encapsulating state, instructions and execution and communicating via async queued messaging
  • 34. actor actor actor actor csp actor actor actor actor os process actor actor actor actor actor actor actor actor
  • 35. csp csp csp csp csp csp csp csp machine csp csp csp csp csp csp csp csp
  • 36. machine machine machine machine machine machine machine machine cluster machine machine machine machine machine machine machine machine
  • 37. some fun speculation what about cores? a prediction based on this pattern
  • 38. traditional SISD architecture works, but clock speed growth is slowing and silicon is cheap core bus memory
  • 39. current MISD architecture bus bottleneck - memory performance per core drops as core count increases core core bus memory
  • 40. future MIMD architecture? the actor pattern on the hardware level a connection machine on a chip core SISD SISD SISD SI SISD memory SISD SISD SISD SISD SI SISD SISD SISD SISD SI
  • 41. automatic MIMD distribution SISD SISD SISD SISD SI array SISD SISD SISD SISD SI array shard array shard array shard array shard SISD SISD SISD SISD SI
  • 42. this talk, in a nutshell solution problem solution concurrency nondeterminism actors/csp distributed and async transparent distributed actors/csp programming objects and futures high concurrency memory bottleneck user level threads many cores bus bottleneck MIMD www.iolanguage.com steve@dekorte.com