SlideShare a Scribd company logo

C++ Actor Model - You’ve Got Mail ...

Can we move beyond threads and locks to manage concurrency? Are there more advanced models than threads and locks? How do other languages manage the concurrency? We see some examples in others languages and a possible solution in C++. Example code: https://github.com/italiancpp/meetup-milano-2014/tree/master/cpp_actor_model

1 of 37
Download to read offline
www.italiancpp.org
C++ Actor Model
You’ve Got Mail ...
Italian C++ Community
Why are we here?
Italian C++ Community
std::thread/async, isn’t it enough?
Italian C++ Community
std::thread/async, isn’t it enough?
Example code: double_poll
Poll Left Poll Right
Thread 1 Thread 2
Acc
Increment
Add Add
Italian C++ Community
Concurrency model
- Single Thread → Node.js
- Actor Model → Erlang
- CSP → GO
- STM → Clojure
- etc ...
Italian C++ Community
Node.js
It’s simple
One thread
Asynchronous I/O (event-loop)
Ad

Recommended

The Actor Model - Towards Better Concurrency
The Actor Model - Towards Better ConcurrencyThe Actor Model - Towards Better Concurrency
The Actor Model - Towards Better ConcurrencyDror Bereznitsky
 
Actor Patterns and NATS - Boulder Meetup
Actor Patterns and NATS - Boulder MeetupActor Patterns and NATS - Boulder Meetup
Actor Patterns and NATS - Boulder MeetupApcera
 
Actors and Threads
Actors and ThreadsActors and Threads
Actors and Threadsmperham
 
Multithreading and concurrency in android
Multithreading and concurrency in androidMultithreading and concurrency in android
Multithreading and concurrency in androidRakesh Jha
 
Deep dive into Xtext scoping local and global scopes explained
Deep dive into Xtext scoping local and global scopes explainedDeep dive into Xtext scoping local and global scopes explained
Deep dive into Xtext scoping local and global scopes explainedHolger Schill
 
Tensorflow on Android
Tensorflow on AndroidTensorflow on Android
Tensorflow on AndroidKoan-Sin Tan
 
A peek into Python's Metaclass and Bytecode from a Smalltalk User
A peek into Python's Metaclass and Bytecode from a Smalltalk UserA peek into Python's Metaclass and Bytecode from a Smalltalk User
A peek into Python's Metaclass and Bytecode from a Smalltalk UserKoan-Sin Tan
 

More Related Content

What's hot

Dark Silicon, Mobile Devices, and Possible Open-Source Solutions
Dark Silicon, Mobile Devices, and Possible Open-Source SolutionsDark Silicon, Mobile Devices, and Possible Open-Source Solutions
Dark Silicon, Mobile Devices, and Possible Open-Source SolutionsKoan-Sin Tan
 
Need for Async: Hot pursuit for scalable applications
Need for Async: Hot pursuit for scalable applicationsNeed for Async: Hot pursuit for scalable applications
Need for Async: Hot pursuit for scalable applicationsKonrad Malawski
 
Future of Kotlin - How agile can language development be?
Future of Kotlin - How agile can language development be?Future of Kotlin - How agile can language development be?
Future of Kotlin - How agile can language development be?Andrey Breslav
 
Introduction to the intermediate Python - v1.1
Introduction to the intermediate Python - v1.1Introduction to the intermediate Python - v1.1
Introduction to the intermediate Python - v1.1Andrei KUCHARAVY
 
Introduction to Kotlin for Java developer
Introduction to Kotlin for Java developerIntroduction to Kotlin for Java developer
Introduction to Kotlin for Java developerShuhei Shogen
 
A Taste of Clojure
A Taste of ClojureA Taste of Clojure
A Taste of ClojureDavid Leung
 
Kotlin Language powerpoint show file
Kotlin Language powerpoint show fileKotlin Language powerpoint show file
Kotlin Language powerpoint show fileSaurabh Tripathi
 
A gentle introduction into AKKA and the actor model
A gentle introduction into AKKA and the actor modelA gentle introduction into AKKA and the actor model
A gentle introduction into AKKA and the actor modelMykhailo Kotsur
 
Xtext beyond the defaults - how to tackle performance problems
Xtext beyond the defaults -  how to tackle performance problemsXtext beyond the defaults -  how to tackle performance problems
Xtext beyond the defaults - how to tackle performance problemsHolger Schill
 
Real world functional reactive programming
Real world functional reactive programmingReal world functional reactive programming
Real world functional reactive programmingEric Polerecky
 
Working With Concurrency In Java 8
Working With Concurrency In Java 8Working With Concurrency In Java 8
Working With Concurrency In Java 8Heartin Jacob
 
ScalaSwarm 2017 Keynote: Tough this be madness yet theres method in't
ScalaSwarm 2017 Keynote: Tough this be madness yet theres method in'tScalaSwarm 2017 Keynote: Tough this be madness yet theres method in't
ScalaSwarm 2017 Keynote: Tough this be madness yet theres method in'tKonrad Malawski
 
Erlang For Five Nines
Erlang For Five NinesErlang For Five Nines
Erlang For Five NinesBarcamp Cork
 

What's hot (20)

Dark Silicon, Mobile Devices, and Possible Open-Source Solutions
Dark Silicon, Mobile Devices, and Possible Open-Source SolutionsDark Silicon, Mobile Devices, and Possible Open-Source Solutions
Dark Silicon, Mobile Devices, and Possible Open-Source Solutions
 
Need for Async: Hot pursuit for scalable applications
Need for Async: Hot pursuit for scalable applicationsNeed for Async: Hot pursuit for scalable applications
Need for Async: Hot pursuit for scalable applications
 
Future of Kotlin - How agile can language development be?
Future of Kotlin - How agile can language development be?Future of Kotlin - How agile can language development be?
Future of Kotlin - How agile can language development be?
 
Introduction to the intermediate Python - v1.1
Introduction to the intermediate Python - v1.1Introduction to the intermediate Python - v1.1
Introduction to the intermediate Python - v1.1
 
Introduction to Kotlin for Java developer
Introduction to Kotlin for Java developerIntroduction to Kotlin for Java developer
Introduction to Kotlin for Java developer
 
A Taste of Clojure
A Taste of ClojureA Taste of Clojure
A Taste of Clojure
 
Kotlin Language powerpoint show file
Kotlin Language powerpoint show fileKotlin Language powerpoint show file
Kotlin Language powerpoint show file
 
Android with kotlin course
Android with kotlin courseAndroid with kotlin course
Android with kotlin course
 
Kotlin - Better Java
Kotlin - Better JavaKotlin - Better Java
Kotlin - Better Java
 
Fork Join
Fork JoinFork Join
Fork Join
 
Erlang OTP
Erlang OTPErlang OTP
Erlang OTP
 
A gentle introduction into AKKA and the actor model
A gentle introduction into AKKA and the actor modelA gentle introduction into AKKA and the actor model
A gentle introduction into AKKA and the actor model
 
Fork/Join for Fun and Profit!
Fork/Join for Fun and Profit!Fork/Join for Fun and Profit!
Fork/Join for Fun and Profit!
 
Xtext beyond the defaults - how to tackle performance problems
Xtext beyond the defaults -  how to tackle performance problemsXtext beyond the defaults -  how to tackle performance problems
Xtext beyond the defaults - how to tackle performance problems
 
Kotlin
KotlinKotlin
Kotlin
 
Fork Join (BeJUG 2012)
Fork Join (BeJUG 2012)Fork Join (BeJUG 2012)
Fork Join (BeJUG 2012)
 
Real world functional reactive programming
Real world functional reactive programmingReal world functional reactive programming
Real world functional reactive programming
 
Working With Concurrency In Java 8
Working With Concurrency In Java 8Working With Concurrency In Java 8
Working With Concurrency In Java 8
 
ScalaSwarm 2017 Keynote: Tough this be madness yet theres method in't
ScalaSwarm 2017 Keynote: Tough this be madness yet theres method in'tScalaSwarm 2017 Keynote: Tough this be madness yet theres method in't
ScalaSwarm 2017 Keynote: Tough this be madness yet theres method in't
 
Erlang For Five Nines
Erlang For Five NinesErlang For Five Nines
Erlang For Five Nines
 

Viewers also liked

Actor Model and C++: what, why and how?
Actor Model and C++: what, why and how?Actor Model and C++: what, why and how?
Actor Model and C++: what, why and how?Yauheni Akhotnikau
 
The Actor Model applied to the Raspberry Pi and the Embedded Domain
The Actor Model applied to the Raspberry Pi and the Embedded DomainThe Actor Model applied to the Raspberry Pi and the Embedded Domain
The Actor Model applied to the Raspberry Pi and the Embedded DomainOmer Kilic
 
CodeFest 2012. Трескин М. — Разработка Web-приложений на Comet-сервере Nitrogen
CodeFest 2012. Трескин М. — Разработка Web-приложений на Comet-сервере NitrogenCodeFest 2012. Трескин М. — Разработка Web-приложений на Comet-сервере Nitrogen
CodeFest 2012. Трескин М. — Разработка Web-приложений на Comet-сервере NitrogenCodeFest
 
Erlang vs. Java
Erlang vs. JavaErlang vs. Java
Erlang vs. JavaArtan Cami
 
Модель акторов и C++ что, зачем и как?
Модель акторов и C++ что, зачем и как?Модель акторов и C++ что, зачем и как?
Модель акторов и C++ что, зачем и как?Yauheni Akhotnikau
 
Шишки, набитые за 15 лет использования акторов в C++
Шишки, набитые за 15 лет использования акторов в C++Шишки, набитые за 15 лет использования акторов в C++
Шишки, набитые за 15 лет использования акторов в C++Yauheni Akhotnikau
 
맛만 보자 액터 모델이란
맛만 보자 액터 모델이란 맛만 보자 액터 모델이란
맛만 보자 액터 모델이란 jbugkorea
 
thread-clustering
thread-clusteringthread-clustering
thread-clusteringdavidkftam
 
Использование юнит-тестов для повышения качества разработки
Использование юнит-тестов для повышения качества разработкиИспользование юнит-тестов для повышения качества разработки
Использование юнит-тестов для повышения качества разработкиvictor-yastrebov
 
Евгений Рыжков, Андрей Карпов Как потратить 10 лет на разработку анализатора ...
Евгений Рыжков, Андрей Карпов Как потратить 10 лет на разработку анализатора ...Евгений Рыжков, Андрей Карпов Как потратить 10 лет на разработку анализатора ...
Евгений Рыжков, Андрей Карпов Как потратить 10 лет на разработку анализатора ...Platonov Sergey
 
Алексей Кутумов, C++ без исключений, часть 3
Алексей Кутумов,  C++ без исключений, часть 3Алексей Кутумов,  C++ без исключений, часть 3
Алексей Кутумов, C++ без исключений, часть 3Platonov Sergey
 
Фитнес для вашего кода: как держать его в форме
Фитнес для вашего кода: как держать его в формеФитнес для вашего кода: как держать его в форме
Фитнес для вашего кода: как держать его в формеIlia Shishkov
 
Galvin-operating System(Ch8)
Galvin-operating System(Ch8)Galvin-operating System(Ch8)
Galvin-operating System(Ch8)dsuyal1
 
Lecture5
Lecture5Lecture5
Lecture5jntu
 

Viewers also liked (20)

Actor Model and C++: what, why and how?
Actor Model and C++: what, why and how?Actor Model and C++: what, why and how?
Actor Model and C++: what, why and how?
 
The Actor Model applied to the Raspberry Pi and the Embedded Domain
The Actor Model applied to the Raspberry Pi and the Embedded DomainThe Actor Model applied to the Raspberry Pi and the Embedded Domain
The Actor Model applied to the Raspberry Pi and the Embedded Domain
 
Erlang&rails
Erlang&railsErlang&rails
Erlang&rails
 
CodeFest 2012. Трескин М. — Разработка Web-приложений на Comet-сервере Nitrogen
CodeFest 2012. Трескин М. — Разработка Web-приложений на Comet-сервере NitrogenCodeFest 2012. Трескин М. — Разработка Web-приложений на Comet-сервере Nitrogen
CodeFest 2012. Трескин М. — Разработка Web-приложений на Comet-сервере Nitrogen
 
Erlang vs. Java
Erlang vs. JavaErlang vs. Java
Erlang vs. Java
 
Модель акторов и C++ что, зачем и как?
Модель акторов и C++ что, зачем и как?Модель акторов и C++ что, зачем и как?
Модель акторов и C++ что, зачем и как?
 
Шишки, набитые за 15 лет использования акторов в C++
Шишки, набитые за 15 лет использования акторов в C++Шишки, набитые за 15 лет использования акторов в C++
Шишки, набитые за 15 лет использования акторов в C++
 
Http streaming
Http streamingHttp streaming
Http streaming
 
Java Threading
Java ThreadingJava Threading
Java Threading
 
Deadlock
DeadlockDeadlock
Deadlock
 
맛만 보자 액터 모델이란
맛만 보자 액터 모델이란 맛만 보자 액터 모델이란
맛만 보자 액터 모델이란
 
thread-clustering
thread-clusteringthread-clustering
thread-clustering
 
Использование юнит-тестов для повышения качества разработки
Использование юнит-тестов для повышения качества разработкиИспользование юнит-тестов для повышения качества разработки
Использование юнит-тестов для повышения качества разработки
 
Евгений Рыжков, Андрей Карпов Как потратить 10 лет на разработку анализатора ...
Евгений Рыжков, Андрей Карпов Как потратить 10 лет на разработку анализатора ...Евгений Рыжков, Андрей Карпов Как потратить 10 лет на разработку анализатора ...
Евгений Рыжков, Андрей Карпов Как потратить 10 лет на разработку анализатора ...
 
Алексей Кутумов, C++ без исключений, часть 3
Алексей Кутумов,  C++ без исключений, часть 3Алексей Кутумов,  C++ без исключений, часть 3
Алексей Кутумов, C++ без исключений, часть 3
 
Фитнес для вашего кода: как держать его в форме
Фитнес для вашего кода: как держать его в формеФитнес для вашего кода: как держать его в форме
Фитнес для вашего кода: как держать его в форме
 
Galvin-operating System(Ch8)
Galvin-operating System(Ch8)Galvin-operating System(Ch8)
Galvin-operating System(Ch8)
 
Ch05
Ch05Ch05
Ch05
 
Threading
ThreadingThreading
Threading
 
Lecture5
Lecture5Lecture5
Lecture5
 

Similar to C++ Actor Model - You’ve Got Mail ...

Apidays Paris 2023 - Forget TypeScript, Choose Rust to build Robust, Fast and...
Apidays Paris 2023 - Forget TypeScript, Choose Rust to build Robust, Fast and...Apidays Paris 2023 - Forget TypeScript, Choose Rust to build Robust, Fast and...
Apidays Paris 2023 - Forget TypeScript, Choose Rust to build Robust, Fast and...apidays
 
Kernel Recipes 2019 - Metrics are money
Kernel Recipes 2019 - Metrics are moneyKernel Recipes 2019 - Metrics are money
Kernel Recipes 2019 - Metrics are moneyAnne Nicolas
 
Docker and Fluentd
Docker and FluentdDocker and Fluentd
Docker and FluentdN Masahiro
 
The Onward Journey: Porting Twisted to Python 3
The Onward Journey: Porting Twisted to Python 3The Onward Journey: Porting Twisted to Python 3
The Onward Journey: Porting Twisted to Python 3Craig Rodrigues
 
Pylons + Tokyo Cabinet
Pylons + Tokyo CabinetPylons + Tokyo Cabinet
Pylons + Tokyo CabinetBen Cheng
 
Static Code Analysis and AutoLint
Static Code Analysis and AutoLintStatic Code Analysis and AutoLint
Static Code Analysis and AutoLintLeander Hasty
 
OnAndroidConf 2013: Accelerating the Android Platform Build
OnAndroidConf 2013: Accelerating the Android Platform BuildOnAndroidConf 2013: Accelerating the Android Platform Build
OnAndroidConf 2013: Accelerating the Android Platform BuildDavid Rosen
 
Internazionalizza le tue applicazioni
Internazionalizza le tue applicazioniInternazionalizza le tue applicazioni
Internazionalizza le tue applicazioniQT-day
 
Node.js meetup 17.05.2017 ember.js - escape the javascript fatigue
Node.js meetup 17.05.2017   ember.js - escape the javascript fatigueNode.js meetup 17.05.2017   ember.js - escape the javascript fatigue
Node.js meetup 17.05.2017 ember.js - escape the javascript fatigueTobias Braner
 
How my visualization tools use little memory: A tale of incrementalization an...
How my visualization tools use little memory: A tale of incrementalization an...How my visualization tools use little memory: A tale of incrementalization an...
How my visualization tools use little memory: A tale of incrementalization an...Eugene Kirpichov
 
Experience with C++11 in ArangoDB
Experience with C++11 in ArangoDBExperience with C++11 in ArangoDB
Experience with C++11 in ArangoDBMax Neunhöffer
 
Use React tools for better Angular apps
Use React tools for better Angular appsUse React tools for better Angular apps
Use React tools for better Angular appsMartin Hochel
 
Original slides from Ryan Dahl's NodeJs intro talk
Original slides from Ryan Dahl's NodeJs intro talkOriginal slides from Ryan Dahl's NodeJs intro talk
Original slides from Ryan Dahl's NodeJs intro talkAarti Parikh
 
Building scalable and language independent java services using apache thrift
Building scalable and language independent java services using apache thriftBuilding scalable and language independent java services using apache thrift
Building scalable and language independent java services using apache thriftTalentica Software
 
.Net Architecture and Performance Tuning
.Net Architecture and Performance Tuning.Net Architecture and Performance Tuning
.Net Architecture and Performance TuningGauranG Bajpai
 
Node.js: A Guided Tour
Node.js: A Guided TourNode.js: A Guided Tour
Node.js: A Guided Tourcacois
 
Per aspera ad grid To the grid computing through difficulties
Per aspera ad grid To the grid computing through difficultiesPer aspera ad grid To the grid computing through difficulties
Per aspera ad grid To the grid computing through difficultiesFerenc Szalai
 

Similar to C++ Actor Model - You’ve Got Mail ... (20)

Apidays Paris 2023 - Forget TypeScript, Choose Rust to build Robust, Fast and...
Apidays Paris 2023 - Forget TypeScript, Choose Rust to build Robust, Fast and...Apidays Paris 2023 - Forget TypeScript, Choose Rust to build Robust, Fast and...
Apidays Paris 2023 - Forget TypeScript, Choose Rust to build Robust, Fast and...
 
Code is art
Code is artCode is art
Code is art
 
Kernel Recipes 2019 - Metrics are money
Kernel Recipes 2019 - Metrics are moneyKernel Recipes 2019 - Metrics are money
Kernel Recipes 2019 - Metrics are money
 
Docker and Fluentd
Docker and FluentdDocker and Fluentd
Docker and Fluentd
 
The Onward Journey: Porting Twisted to Python 3
The Onward Journey: Porting Twisted to Python 3The Onward Journey: Porting Twisted to Python 3
The Onward Journey: Porting Twisted to Python 3
 
Return of c++
Return of c++Return of c++
Return of c++
 
Pylons + Tokyo Cabinet
Pylons + Tokyo CabinetPylons + Tokyo Cabinet
Pylons + Tokyo Cabinet
 
Static Code Analysis and AutoLint
Static Code Analysis and AutoLintStatic Code Analysis and AutoLint
Static Code Analysis and AutoLint
 
OnAndroidConf 2013: Accelerating the Android Platform Build
OnAndroidConf 2013: Accelerating the Android Platform BuildOnAndroidConf 2013: Accelerating the Android Platform Build
OnAndroidConf 2013: Accelerating the Android Platform Build
 
Internazionalizza le tue applicazioni
Internazionalizza le tue applicazioniInternazionalizza le tue applicazioni
Internazionalizza le tue applicazioni
 
Node.js meetup 17.05.2017 ember.js - escape the javascript fatigue
Node.js meetup 17.05.2017   ember.js - escape the javascript fatigueNode.js meetup 17.05.2017   ember.js - escape the javascript fatigue
Node.js meetup 17.05.2017 ember.js - escape the javascript fatigue
 
netty_qcon_v4
netty_qcon_v4netty_qcon_v4
netty_qcon_v4
 
How my visualization tools use little memory: A tale of incrementalization an...
How my visualization tools use little memory: A tale of incrementalization an...How my visualization tools use little memory: A tale of incrementalization an...
How my visualization tools use little memory: A tale of incrementalization an...
 
Experience with C++11 in ArangoDB
Experience with C++11 in ArangoDBExperience with C++11 in ArangoDB
Experience with C++11 in ArangoDB
 
Use React tools for better Angular apps
Use React tools for better Angular appsUse React tools for better Angular apps
Use React tools for better Angular apps
 
Original slides from Ryan Dahl's NodeJs intro talk
Original slides from Ryan Dahl's NodeJs intro talkOriginal slides from Ryan Dahl's NodeJs intro talk
Original slides from Ryan Dahl's NodeJs intro talk
 
Building scalable and language independent java services using apache thrift
Building scalable and language independent java services using apache thriftBuilding scalable and language independent java services using apache thrift
Building scalable and language independent java services using apache thrift
 
.Net Architecture and Performance Tuning
.Net Architecture and Performance Tuning.Net Architecture and Performance Tuning
.Net Architecture and Performance Tuning
 
Node.js: A Guided Tour
Node.js: A Guided TourNode.js: A Guided Tour
Node.js: A Guided Tour
 
Per aspera ad grid To the grid computing through difficulties
Per aspera ad grid To the grid computing through difficultiesPer aspera ad grid To the grid computing through difficulties
Per aspera ad grid To the grid computing through difficulties
 

More from Gianluca Padovani

A Gentle introduction to microservices
A Gentle introduction to microservicesA Gentle introduction to microservices
A Gentle introduction to microservicesGianluca Padovani
 
Beam me up, scotty (PUG Roma)
Beam me up, scotty (PUG Roma)Beam me up, scotty (PUG Roma)
Beam me up, scotty (PUG Roma)Gianluca Padovani
 
Tdd is not about testing (C++ version)
Tdd is not about testing (C++ version)Tdd is not about testing (C++ version)
Tdd is not about testing (C++ version)Gianluca Padovani
 
Tdd is not about testing (OOP)
Tdd is not about testing (OOP)Tdd is not about testing (OOP)
Tdd is not about testing (OOP)Gianluca Padovani
 
DDD loves Actor Model and Actor Model loves Elixir
DDD loves Actor Model and Actor Model loves ElixirDDD loves Actor Model and Actor Model loves Elixir
DDD loves Actor Model and Actor Model loves ElixirGianluca Padovani
 
From a web application to a distributed system
From a web application to a distributed systemFrom a web application to a distributed system
From a web application to a distributed systemGianluca Padovani
 
System integration through queues
System integration through queuesSystem integration through queues
System integration through queuesGianluca Padovani
 
La mia prima lezione di pozioni
La mia prima lezione di pozioniLa mia prima lezione di pozioni
La mia prima lezione di pozioniGianluca Padovani
 
Keynote meetup Elixir/Erlang 17 ottobre 2015
Keynote meetup Elixir/Erlang 17 ottobre 2015Keynote meetup Elixir/Erlang 17 ottobre 2015
Keynote meetup Elixir/Erlang 17 ottobre 2015Gianluca Padovani
 

More from Gianluca Padovani (16)

A Gentle introduction to microservices
A Gentle introduction to microservicesA Gentle introduction to microservices
A Gentle introduction to microservices
 
Beam me up, scotty (PUG Roma)
Beam me up, scotty (PUG Roma)Beam me up, scotty (PUG Roma)
Beam me up, scotty (PUG Roma)
 
Tdd is not about testing (C++ version)
Tdd is not about testing (C++ version)Tdd is not about testing (C++ version)
Tdd is not about testing (C++ version)
 
Tdd is not about testing (OOP)
Tdd is not about testing (OOP)Tdd is not about testing (OOP)
Tdd is not about testing (OOP)
 
DDD loves Actor Model and Actor Model loves Elixir
DDD loves Actor Model and Actor Model loves ElixirDDD loves Actor Model and Actor Model loves Elixir
DDD loves Actor Model and Actor Model loves Elixir
 
Tdd is not about testing
Tdd is not about testingTdd is not about testing
Tdd is not about testing
 
From a web application to a distributed system
From a web application to a distributed systemFrom a web application to a distributed system
From a web application to a distributed system
 
Beam way of life
Beam way of lifeBeam way of life
Beam way of life
 
Cook your KV
Cook your KVCook your KV
Cook your KV
 
System integration through queues
System integration through queuesSystem integration through queues
System integration through queues
 
Beam me up, Scotty
Beam me up, ScottyBeam me up, Scotty
Beam me up, Scotty
 
Docker e git lab
Docker e git labDocker e git lab
Docker e git lab
 
La mia prima lezione di pozioni
La mia prima lezione di pozioniLa mia prima lezione di pozioni
La mia prima lezione di pozioni
 
Keynote meetup Elixir/Erlang 17 ottobre 2015
Keynote meetup Elixir/Erlang 17 ottobre 2015Keynote meetup Elixir/Erlang 17 ottobre 2015
Keynote meetup Elixir/Erlang 17 ottobre 2015
 
Ferrara Linux Day 2011
Ferrara Linux Day 2011Ferrara Linux Day 2011
Ferrara Linux Day 2011
 
OOP vs COP
OOP vs COPOOP vs COP
OOP vs COP
 

Recently uploaded

Sql server types of joins with example.pptx
Sql server types of joins with example.pptxSql server types of joins with example.pptx
Sql server types of joins with example.pptxsameer gaikwad
 
killing camp week 6 problem - maximal matrix.pdf
killing camp week 6 problem - maximal matrix.pdfkilling camp week 6 problem - maximal matrix.pdf
killing camp week 6 problem - maximal matrix.pdfssuser82c38d
 
100 TOOLS TO MEASURE AND ANALYSE YOUR DIGITAL MARKETING EFFORTS
100 TOOLS TO MEASURE AND ANALYSE YOUR DIGITAL MARKETING EFFORTS100 TOOLS TO MEASURE AND ANALYSE YOUR DIGITAL MARKETING EFFORTS
100 TOOLS TO MEASURE AND ANALYSE YOUR DIGITAL MARKETING EFFORTSi-engage
 
P1 Inspection Types in Municity 5 Smartsheet
P1 Inspection Types in Municity 5 SmartsheetP1 Inspection Types in Municity 5 Smartsheet
P1 Inspection Types in Municity 5 SmartsheetMatthewTHawley
 
Getting Started with Trello for Beginners.pptx
Getting Started with Trello for Beginners.pptxGetting Started with Trello for Beginners.pptx
Getting Started with Trello for Beginners.pptxmavinoikein
 
Essence of Requirements Engineering: Pragmatic Insights for 2024
Essence of Requirements Engineering: Pragmatic Insights for 2024Essence of Requirements Engineering: Pragmatic Insights for 2024
Essence of Requirements Engineering: Pragmatic Insights for 2024Asher Sterkin
 
killingcamp longest common subsequence.pdf
killingcamp longest common subsequence.pdfkillingcamp longest common subsequence.pdf
killingcamp longest common subsequence.pdfssuser82c38d
 
DBA Fundamentals Group: Continuous SQL with Kafka and Flink
DBA Fundamentals Group: Continuous SQL with Kafka and FlinkDBA Fundamentals Group: Continuous SQL with Kafka and Flink
DBA Fundamentals Group: Continuous SQL with Kafka and FlinkTimothy Spann
 
SPM 2024 – Overview of and benefits of AI in Product Management
SPM 2024 – Overview of and benefits of AI in Product ManagementSPM 2024 – Overview of and benefits of AI in Product Management
SPM 2024 – Overview of and benefits of AI in Product ManagementISPMAIndia
 
Self scaling Multi cloud nomad workloads
Self scaling Multi cloud nomad workloadsSelf scaling Multi cloud nomad workloads
Self scaling Multi cloud nomad workloadsBram Vogelaar
 
App Builder - Hierarchical Data Apps.pptx
App Builder - Hierarchical Data Apps.pptxApp Builder - Hierarchical Data Apps.pptx
App Builder - Hierarchical Data Apps.pptxPoojitha B
 
The Game-Changer_ How Software Development Outsource Can Catapult Your Growth...
The Game-Changer_ How Software Development Outsource Can Catapult Your Growth...The Game-Changer_ How Software Development Outsource Can Catapult Your Growth...
The Game-Changer_ How Software Development Outsource Can Catapult Your Growth...emili denli
 
OpenChain AI Study Group - North America and Europe - 2024-02-20
OpenChain AI Study Group - North America and Europe - 2024-02-20OpenChain AI Study Group - North America and Europe - 2024-02-20
OpenChain AI Study Group - North America and Europe - 2024-02-20Shane Coughlan
 
Software Testing life cycle (STLC) Importance, Phases, Benefits...
Software Testing life cycle (STLC) Importance, Phases, Benefits...Software Testing life cycle (STLC) Importance, Phases, Benefits...
Software Testing life cycle (STLC) Importance, Phases, Benefits...Flexsin
 
AUTOKEYUNLOCKER-BRANDS-SUPPORT-STANDARD-VERSION.pdf
AUTOKEYUNLOCKER-BRANDS-SUPPORT-STANDARD-VERSION.pdfAUTOKEYUNLOCKER-BRANDS-SUPPORT-STANDARD-VERSION.pdf
AUTOKEYUNLOCKER-BRANDS-SUPPORT-STANDARD-VERSION.pdfAutokey
 
killingcamp 광고삽입문제 풀이, killingcamp 광고삽입문제 풀이
killingcamp 광고삽입문제 풀이, killingcamp 광고삽입문제 풀이killingcamp 광고삽입문제 풀이, killingcamp 광고삽입문제 풀이
killingcamp 광고삽입문제 풀이, killingcamp 광고삽입문제 풀이ssuser82c38d
 
Industry 4.0: Building the Unified Namespace with Confluent, HiveMQ and Spark...
Industry 4.0: Building the Unified Namespace with Confluent, HiveMQ and Spark...Industry 4.0: Building the Unified Namespace with Confluent, HiveMQ and Spark...
Industry 4.0: Building the Unified Namespace with Confluent, HiveMQ and Spark...confluent
 
Open Sprintera (Where Open Source Sparks a Sprint of Possibilities)
Open Sprintera (Where Open Source Sparks a Sprint of Possibilities)Open Sprintera (Where Open Source Sparks a Sprint of Possibilities)
Open Sprintera (Where Open Source Sparks a Sprint of Possibilities)GDSCNiT
 
maximum subarray ppt for killing camp students
maximum subarray ppt for killing camp studentsmaximum subarray ppt for killing camp students
maximum subarray ppt for killing camp studentsssuser82c38d
 

Recently uploaded (20)

Sql server types of joins with example.pptx
Sql server types of joins with example.pptxSql server types of joins with example.pptx
Sql server types of joins with example.pptx
 
killing camp week 6 problem - maximal matrix.pdf
killing camp week 6 problem - maximal matrix.pdfkilling camp week 6 problem - maximal matrix.pdf
killing camp week 6 problem - maximal matrix.pdf
 
100 TOOLS TO MEASURE AND ANALYSE YOUR DIGITAL MARKETING EFFORTS
100 TOOLS TO MEASURE AND ANALYSE YOUR DIGITAL MARKETING EFFORTS100 TOOLS TO MEASURE AND ANALYSE YOUR DIGITAL MARKETING EFFORTS
100 TOOLS TO MEASURE AND ANALYSE YOUR DIGITAL MARKETING EFFORTS
 
P1 Inspection Types in Municity 5 Smartsheet
P1 Inspection Types in Municity 5 SmartsheetP1 Inspection Types in Municity 5 Smartsheet
P1 Inspection Types in Municity 5 Smartsheet
 
Getting Started with Trello for Beginners.pptx
Getting Started with Trello for Beginners.pptxGetting Started with Trello for Beginners.pptx
Getting Started with Trello for Beginners.pptx
 
Essence of Requirements Engineering: Pragmatic Insights for 2024
Essence of Requirements Engineering: Pragmatic Insights for 2024Essence of Requirements Engineering: Pragmatic Insights for 2024
Essence of Requirements Engineering: Pragmatic Insights for 2024
 
killingcamp longest common subsequence.pdf
killingcamp longest common subsequence.pdfkillingcamp longest common subsequence.pdf
killingcamp longest common subsequence.pdf
 
DBA Fundamentals Group: Continuous SQL with Kafka and Flink
DBA Fundamentals Group: Continuous SQL with Kafka and FlinkDBA Fundamentals Group: Continuous SQL with Kafka and Flink
DBA Fundamentals Group: Continuous SQL with Kafka and Flink
 
SPM 2024 – Overview of and benefits of AI in Product Management
SPM 2024 – Overview of and benefits of AI in Product ManagementSPM 2024 – Overview of and benefits of AI in Product Management
SPM 2024 – Overview of and benefits of AI in Product Management
 
Self scaling Multi cloud nomad workloads
Self scaling Multi cloud nomad workloadsSelf scaling Multi cloud nomad workloads
Self scaling Multi cloud nomad workloads
 
App Builder - Hierarchical Data Apps.pptx
App Builder - Hierarchical Data Apps.pptxApp Builder - Hierarchical Data Apps.pptx
App Builder - Hierarchical Data Apps.pptx
 
The Game-Changer_ How Software Development Outsource Can Catapult Your Growth...
The Game-Changer_ How Software Development Outsource Can Catapult Your Growth...The Game-Changer_ How Software Development Outsource Can Catapult Your Growth...
The Game-Changer_ How Software Development Outsource Can Catapult Your Growth...
 
OpenChain AI Study Group - North America and Europe - 2024-02-20
OpenChain AI Study Group - North America and Europe - 2024-02-20OpenChain AI Study Group - North America and Europe - 2024-02-20
OpenChain AI Study Group - North America and Europe - 2024-02-20
 
Software Testing life cycle (STLC) Importance, Phases, Benefits...
Software Testing life cycle (STLC) Importance, Phases, Benefits...Software Testing life cycle (STLC) Importance, Phases, Benefits...
Software Testing life cycle (STLC) Importance, Phases, Benefits...
 
AUTOKEYUNLOCKER-BRANDS-SUPPORT-STANDARD-VERSION.pdf
AUTOKEYUNLOCKER-BRANDS-SUPPORT-STANDARD-VERSION.pdfAUTOKEYUNLOCKER-BRANDS-SUPPORT-STANDARD-VERSION.pdf
AUTOKEYUNLOCKER-BRANDS-SUPPORT-STANDARD-VERSION.pdf
 
killingcamp 광고삽입문제 풀이, killingcamp 광고삽입문제 풀이
killingcamp 광고삽입문제 풀이, killingcamp 광고삽입문제 풀이killingcamp 광고삽입문제 풀이, killingcamp 광고삽입문제 풀이
killingcamp 광고삽입문제 풀이, killingcamp 광고삽입문제 풀이
 
eLearning Content Development Company Code and Pixels.pdf
eLearning Content Development Company Code and Pixels.pdfeLearning Content Development Company Code and Pixels.pdf
eLearning Content Development Company Code and Pixels.pdf
 
Industry 4.0: Building the Unified Namespace with Confluent, HiveMQ and Spark...
Industry 4.0: Building the Unified Namespace with Confluent, HiveMQ and Spark...Industry 4.0: Building the Unified Namespace with Confluent, HiveMQ and Spark...
Industry 4.0: Building the Unified Namespace with Confluent, HiveMQ and Spark...
 
Open Sprintera (Where Open Source Sparks a Sprint of Possibilities)
Open Sprintera (Where Open Source Sparks a Sprint of Possibilities)Open Sprintera (Where Open Source Sparks a Sprint of Possibilities)
Open Sprintera (Where Open Source Sparks a Sprint of Possibilities)
 
maximum subarray ppt for killing camp students
maximum subarray ppt for killing camp studentsmaximum subarray ppt for killing camp students
maximum subarray ppt for killing camp students
 

C++ Actor Model - You’ve Got Mail ...

  • 4. Italian C++ Community std::thread/async, isn’t it enough? Example code: double_poll Poll Left Poll Right Thread 1 Thread 2 Acc Increment Add Add
  • 5. Italian C++ Community Concurrency model - Single Thread → Node.js - Actor Model → Erlang - CSP → GO - STM → Clojure - etc ...
  • 6. Italian C++ Community Node.js It’s simple One thread Asynchronous I/O (event-loop)
  • 7. Italian C++ Community Node.js - Examples var fs = require("fs"); fs.readFile('/etc/passwd', function (err, data) { if (err) throw err; console.log("-> " + data + " <-"); }); ---- var http = require('http'); http.createServer(function (req, res) { res.writeHead(200, {'Content-Type': 'text/plain'}); res.end('Hello Worldn'); }).listen(1337, "127.0.0.1"); console.log('Server running at http://127.0.0.1:1337/');
  • 8. Italian C++ Community Node.js - Is it fast? ab -n 10000 -c 1000 http://127.0.0.1:1337/ Time taken for tests: 1.283 seconds Complete requests: 10000 Total transferred: 1130000 bytes Requests per second: 7797.21 [#/sec] (mean) Time per request: 128.251 [ms] (mean) Time per request: 0.128 [ms] (mean, across all concurrent requests) Transfer rate: 860.43 [Kbytes/sec] received Connection Times (ms) min mean[+/-sd] median max Connect: 0 58 232.7 0 1000 Processing: 5 20 27.1 13 420 Waiting: 5 20 27.1 13 420 Total: 13 78 246.5 13 1234
  • 9. Italian C++ Community Node.js - Is it fast? YES!!!
  • 10. Italian C++ Community Concurrency model Single Thread → Node.js (Good) Can we do better? Copy from others ...
  • 11. Italian C++ Community Erlang Erlang is a programming language used to build massively scalable soft real-time systems with requirements on high availability.
  • 13. Italian C++ Community A model of concurrent computation that treats "actors" as the primitives and fundamental units of computation. Actor Model
  • 14. Italian C++ Community Actor Model It should embody three properties: ● Processing → Can do something ● Storage → Can remember something ● Communication → Can communicate with others
  • 15. Italian C++ Community Actor Model In an actors system: ● Everything is an actor ● An actor is an entity that sends, receives messages ● An actor is an entity with a behaviour
  • 16. Italian C++ Community In response to a message that it receives, an actor can: ● create more actors ● send messages to other actors ● determine how to respond to the next message received Actor Model
  • 17. Italian C++ Community Actor Model A1 A3 M1 A21 A22 A23 M2 M3 A2
  • 18. Italian C++ Community Actor Model Does it work? Is it fast?
  • 19. Italian C++ Community Erlang - Results ab -n 10000 -c 1000 http://127.0.0.1:8080/ Time taken for tests: 0.538 seconds Complete requests: 10000 Total transferred: 1300000 bytes Requests per second: 18604.20 [#/sec] (mean) Time per request: 53.751 [ms] (mean) Time per request: 0.054 [ms] (mean, across all concurrent requests) Transfer rate: 2361.86 [Kbytes/sec] received Connection Times (ms) min mean[+/-sd] median max Connect: 0 10 4.8 10 27 Processing: 7 16 4.8 16 39 Waiting: 5 13 4.2 13 34 Total: 8 26 8.3 26 59
  • 20. Italian C++ Community Erlang vs Node.js - Results Node.js Time taken for tests: 1.461 seconds Total transferred: 1140000 bytes Requests per second: 6843.55 [#/sec] Time per request: 146.123 [ms] Time per request: 0.146 [ms] Transfer rate: 761.88 [Kbytes/sec] Connection Times (ms) min mean[+/-sd] median max Connect: 0 59 234.5 0 1001 Processing: 8 22 40.7 14 443 Waiting: 7 22 40.7 14 443 Total: 10 81 262.9 14 1443 Erlang Time taken for tests: 0.538 seconds Total transferred: 1300000 bytes Requests per second: 18604.20 [#/sec] Time per request: 53.751 [ms] Time per request: 0.054 [ms] Transfer rate: 2361.86 [Kbytes/sec] Connection Times (ms) min mean[+/-sd] median max Connect: 0 10 4.8 10 27 Processing: 7 16 4.8 16 39 Waiting: 5 13 4.2 13 34 Total: 8 26 8.3 26 59
  • 21. Italian C++ Community Actor Model - Is it Fast? YES!!!
  • 22. Italian C++ Community Erlang - Example https://github.com/extend/cowboy
  • 23. Italian C++ Community C++ - Actor model
  • 24. Italian C++ Community C++ library ● http://neverlord.github.io/libcppa/ - Erlang inspired ● http://www.theron-library.com/ - No fault - No Event IO ● https://code.google.com/p/actor-cpp/source/list - Not developed since 2012 ● https://code.google.com/p/libactor/ - Right now it is usable, although it may not be ready for production ● https://casablanca.codeplex.com/ - Removed actor?!?! ● http://www.stdthread.co.uk/ - No OSS
  • 25. Italian C++ Community libcppa - Features ● Lightweight actor implementations ● Pattern matching for messages ● Error handling based on Erlang’s failure model ● etc ..
  • 26. Italian C++ Community libcppa - Is it enough? Can it solve the initial problem? example code: double_poll_actor
  • 27. Italian C++ Community libcppa - Is it enough? Main Poll Left Poll Right Acc poll poll at incLeft incRight inc beast beast threshold fire fire
  • 28. Italian C++ Community libcppa - Actor == thread? How many actors can I spawn? A lot!!!! example code: how_many_actors
  • 29. Italian C++ Community libcppa - Errors ● Isolated ● Linked ● Monitored example code: err_mng
  • 30. Italian C++ Community libcppa - I/O - brokers A broker is an event-based actor running in the middleman that multiplexes socket I/O
  • 31. Italian C++ Community libcppa - I/O - brokers ● Create in particular way ● Receive special messages from “system” ● Can take ownership of given connection example code: http_actor
  • 32. Italian C++ Community libcppa - Is it fast??? ab -n 10000 -c 1000 http://127.0.0.1:1339/ Time taken for tests: 0.438 seconds Complete requests: 10000 Total transferred: 1480000 bytes Requests per second: 22848.00 [#/sec] (mean) Time per request: 43.767 [ms] (mean) Time per request: 0.044 [ms] (mean, across all concurrent requests) Transfer rate: 3302.25 [Kbytes/sec] received Connection Times (ms) min mean[+/-sd] median max Connect: 1 5 5.6 3 26 Processing: 1 6 5.9 4 222 Waiting: 1 4 4.8 3 221 Total: 3 11 10.6 7 231
  • 33. Italian C++ Community libcppa vs Erlang - Results libcppa Time taken for tests: 0.438 seconds Total transferred: 1480000 bytes Requests per second: 22848.00 [#/sec] Time per request: 43.767 [ms] Time per request: 0.044 [ms] Transfer rate: 3302.25 [Kbytes/sec] Connection Times (ms) min mean[+/-sd] median max Connect: 1 5 5.6 3 26 Processing: 1 6 5.9 4 222 Waiting: 1 4 4.8 3 221 Total: 3 11 10.6 7 231 Erlang Time taken for tests: 0.538 seconds Total transferred: 1300000 bytes Requests per second: 18604.20 [#/sec] Time per request: 53.751 [ms] Time per request: 0.054 [ms] Transfer rate: 2361.86 [Kbytes/sec] Connection Times (ms) min mean[+/-sd] median max Connect: 0 10 4.8 10 27 Processing: 7 16 4.8 16 39 Waiting: 5 13 4.2 13 34 Total: 8 26 8.3 26 59
  • 34. Italian C++ Community libcppa - Is it fast??? YES!!!
  • 35. Italian C++ Community Actor Model Gianluca Padovani SW craftsmanship, TDD addicted, agile coach. I like Ruby, NodeJs and everything is interesting. I also work a lot on C#, C++. I like to code, a lot :-) https://www.linkedin.com/pub/gianluca-padovani/2/261/a92 https://twitter.com/GPad619 https://github.com/gpad http://www.slideshare.net/gpadovani
  • 36. Italian C++ Community Reference ● Carl Hewitt's Homepage ● Hewitt, Meijer and Szyperski: The Actor Model ● Takeaways from Hewitt, Meijer and Szyperski’s talk on the Actor model ● https://github.com/Neverlord/libcppa ● http://libcppa.blogspot.de/ ● Dominik Charousset and Matthias Vallentin: libcppa -- Designing an Actor Semantic for C++11 ● https://github.com/mavam/vast ● Learn you some Erlang ● https://github.com/extend/cowboy ● Actors are not a good concurrency model ● Seven Languages in Seven Weeks: A Pragmatic Guide to Learning Programming Languages
  • 37. Italian C++ Community Actor Model Thank You!