SlideShare a Scribd company logo
1 of 27
Download to read offline
Robert Virding
                                                            Principle Language Expert
                                                            at Erlang Solutions Ltd.




Erlang Solutions Ltd.
The Design and Implementation of
a Scalable, Concurrent Virtual
Machine
                        © 1999-2011 Erlang Solutions Ltd.
Erlang Solutions Ltd.

• The one stop shop for all your Erlang needs
• Founded in 1999, Offices in UK, Sweden and Poland
• Clients on six continents
• System development experience in:
   -   Telecom, banking, e-commerce, track & trace, VOIP, etc.

• We do:
   -   In-house system development, on-site consultancy, and
       contracting,
   -   Erlang-based recruitment and Professional training at all
       levels

                       © 1999-2011 Erlang Solutions Ltd.       2
Concurrency vs. Parallelism

• Parallelism is what the system provides
• Concurrency is a property of the problem/
  solution


             (as good a definition as any)




                    © 1999-2011 Erlang Solutions Ltd.   3
Erlang is COP

Concurrency Oriented Programming



           © 1999-2011 Erlang Solutions Ltd.   4
Problem domain/Erlang properties

• Light-weight concurrency
• Asynchronous message passing
• Process isolation
• Error handling
• Complex coordination
• Soft real-time
• Continuous evolution of system

                 © 1999-2011 Erlang Solutions Ltd.   5
Erlang is a functional language

• Immutable data
• No looping constructs
• Pattern matching is ubiquitous




                  © 1999-2011 Erlang Solutions Ltd.   6
Communication
• Asynchronous message passing
  -   Scales well
  -   Suits multi-core
      -  needs only limited synchronisation

• Each process has a single message queue
• Selective receive
• Suitable as a building block

                     © 1999-2011 Erlang Solutions Ltd.   7
The BEAM
The main Erlang implementation
Will cover:
• Processes/scheduling
• Memory management
• Communication
• Error handling
(Bogdan’s Erlang Abstract Machine, now Björn’s)

                  © 1999-2011 Erlang Solutions Ltd.   8
Processes and scheduling

• Want light-weight concurency
• Must have processes (isolation)
➡Implement processes ourselves (green processes)

• They are really light-weight
• Complete control of scheduling
• Not a general machine
                  © 1999-2011 Erlang Solutions Ltd.   9
Processes and scheduling

• Pre-emptive scheduling
   -   Scheduled as cooperating coroutines

• One run-queue per thread
• Multi-core/multi-thread ➡ multi-queues
   -   Process stealing


• No really viable alternatives

                      © 1999-2011 Erlang Solutions Ltd.   10
Memory management/GC

• Soft real-time requires unobtrusive GC
• Must ensure process isolation
• Stop-the-world collector
  vs.
  interactive/concurrent collector
  -     independent of parallelism



                      © 1999-2011 Erlang Solutions Ltd.   11
Memory management/GC
Alternatives:


• Shared heap
• Separate process heaps
• Hybrid



                 © 1999-2011 Erlang Solutions Ltd.   12
Memory management/GC


   Erlang does NOT require separate
      heaps and message copying!

• Immutable data means we can safely share


                 © 1999-2011 Erlang Solutions Ltd.   13
Memory management/GC

Shared heap
• Reduces copying of data
  -   Messages shared

• Complicates GC
  -   must use incremental/concurrent collector

• Less well-suited to multi-core
• Complicates handling of processes

                    © 1999-2011 Erlang Solutions Ltd.   14
Memory management/GC

Separate process heaps
• Increases copying of data
  -   messages copied

• Simplifies GC
  -   can use stop-the-world per process collector

• Fits well on multi-core
• Scales well
• Simplifies handling of processes
                     © 1999-2011 Erlang Solutions Ltd.   15
Memory management/GC

Hybrid heaps
• Reduces copying of data
  -   messages on shared heap

• May in part be determined at compile-time
• Complicates GC
• Less well-suited on multi-core


                   © 1999-2011 Erlang Solutions Ltd.   16
Memory management/GC
Erlang BEAM uses very restricted hybrid heaps
• Mainly separate heaps
  -   most of the benefits of separate heaps

• Some shared data
  -   get some benefits of shared data
  -   without too many of the complications




                     © 1999-2011 Erlang Solutions Ltd.   17
Alternative communication

• Share memory communication
  -   synchronisation woes - locking, mutexes ...
  -   scalability?
  -   error handling

• STM (Software Transactional Memory)
  -   scalability?

• Go concurrency motto
  -   "Do not communicate by sharing memory; instead,
      share memory by communicating"

                     © 1999-2011 Erlang Solutions Ltd.   18
Erjang - Erlang on the JVM
A real Erlang on the JVM
Will cover:
• Why the JVM?
• How it runs Erlang code
• Concurrency/scheduling
• Memory management/GC
• Miscellaneous

                   © 1999-2011 Erlang Solutions Ltd.   19
Erjang - Why the JVM?

• Erjang is different from the BEAM
  -   it has different properties

• Very mature VM
• Wide-spread VM
  -   Erlang can run in MANY more places

• Improved interface between Erlang and other JVM
  languages
• Access to libraries
(Kresten wanted to learn Erlang)
                      © 1999-2011 Erlang Solutions Ltd.   20
Erjang - Running Erlang code

• Uses BEAM VM assembler code as source to
  generate Java .class files
  -   helps ensure compatibility




                     © 1999-2011 Erlang Solutions Ltd.   21
Erjang - Concurrency

• Uses Kilim to provide concurrency and message
  passing
  -   ultra light-weight threads
  -   message passing with shared messages

• Cooperative coroutines



                   © 1999-2011 Erlang Solutions Ltd.   22
Erjang - Scheduling

• Pre-emptive scheduling
  -   Scheduled as cooperating coroutines

• One run-queue per thread
• Multi-core/multi-thread ➡ multi-queues




                    © 1999-2011 Erlang Solutions Ltd.   23
Erjang - Memory management/GC

• Uses standard JVM memory management/GC
  -   shared heap
  -   stop-the-world collector


➡Cannot guarantee soft real-time behaviour (yet)
                                    ☹

                     © 1999-2011 Erlang Solutions Ltd.   24
Erjang - Miscellaneous

• Needs special handling for tail-call optimisation
  (a must for functional languages)
  -   BEAM compiler generates different calls
  -   two entry points for each function
  -   common body




                     © 1999-2011 Erlang Solutions Ltd.   25
•   The Erlang User Conference brings together the best minds and names in
    Erlang Programming

•   This year, the Erlang User Conference will be held in a brand new location
    – the exciting, spacious building of the München Bryggeriet.

•   An enticing addition to the 2011 conference will be two further tracks.

•   We will also be holding a day of tutorials on 4 November.

•   In the 3 days prior to the conference, 31 October – 2 November, we will be
    holding an Erlang University with a selection of Erlang courses suitable for
    all levels of expertise.




                             © 1999-2011 Erlang Solutions Ltd.                26
Questions?


               Thank you


               Robert Virding
     robert.virding@erlang-solutions.com




               © 1999-2011 Erlang Solutions Ltd.   27

More Related Content

Similar to The design and implementation of a scalable concurrent virtual machine (Robert Virding)

Erlang workshopdrammen
Erlang workshopdrammenErlang workshopdrammen
Erlang workshopdrammenReidar Sollid
 
OSAC16: Unikernel-powered Transient Microservices: Changing the Face of Softw...
OSAC16: Unikernel-powered Transient Microservices: Changing the Face of Softw...OSAC16: Unikernel-powered Transient Microservices: Changing the Face of Softw...
OSAC16: Unikernel-powered Transient Microservices: Changing the Face of Softw...Russell Pavlicek
 
"erlang, webmail and hibari" at Rakuten tech talk
"erlang, webmail and hibari" at Rakuten tech talk"erlang, webmail and hibari" at Rakuten tech talk
"erlang, webmail and hibari" at Rakuten tech talkCLOUDIAN KK
 
Running Tensorflow In Production: Challenges and Solutions on YARN 3.x
Running Tensorflow In Production: Challenges and Solutions on YARN 3.x Running Tensorflow In Production: Challenges and Solutions on YARN 3.x
Running Tensorflow In Production: Challenges and Solutions on YARN 3.x Wangda Tan
 
Real World Elixir Deployment
Real World Elixir DeploymentReal World Elixir Deployment
Real World Elixir DeploymentPete Gamache
 
Repeating History...On Purpose...with Elixir
Repeating History...On Purpose...with ElixirRepeating History...On Purpose...with Elixir
Repeating History...On Purpose...with ElixirBarry Jones
 
TDC2016SP - Trilha Programação Funcional
TDC2016SP - Trilha Programação FuncionalTDC2016SP - Trilha Programação Funcional
TDC2016SP - Trilha Programação Funcionaltdc-globalcode
 
Erlang sem enrolação
Erlang sem enrolaçãoErlang sem enrolação
Erlang sem enrolaçãoFelipe Mamud
 
z13: New Opportunities – if you dare!
z13: New Opportunities – if you dare!z13: New Opportunities – if you dare!
z13: New Opportunities – if you dare!Michael Erichsen
 
XPDS14: Unikernels: Who, What, Where, When, Why - Adam Wick, Galois
XPDS14: Unikernels: Who, What, Where, When, Why - Adam Wick, GaloisXPDS14: Unikernels: Who, What, Where, When, Why - Adam Wick, Galois
XPDS14: Unikernels: Who, What, Where, When, Why - Adam Wick, GaloisThe Linux Foundation
 
Drive User Adoption And Productivity Using Crm Within Microsoft Outlook
Drive User Adoption And Productivity Using Crm Within Microsoft OutlookDrive User Adoption And Productivity Using Crm Within Microsoft Outlook
Drive User Adoption And Productivity Using Crm Within Microsoft OutlookJerome Leonard
 
Wherefore art thou Erlang?, OW2con'18, June 7-8, 2018, Paris
Wherefore art thou Erlang?, OW2con'18, June 7-8, 2018, ParisWherefore art thou Erlang?, OW2con'18, June 7-8, 2018, Paris
Wherefore art thou Erlang?, OW2con'18, June 7-8, 2018, ParisOW2
 

Similar to The design and implementation of a scalable concurrent virtual machine (Robert Virding) (20)

Erlang workshopdrammen
Erlang workshopdrammenErlang workshopdrammen
Erlang workshopdrammen
 
OSAC16: Unikernel-powered Transient Microservices: Changing the Face of Softw...
OSAC16: Unikernel-powered Transient Microservices: Changing the Face of Softw...OSAC16: Unikernel-powered Transient Microservices: Changing the Face of Softw...
OSAC16: Unikernel-powered Transient Microservices: Changing the Face of Softw...
 
"erlang, webmail and hibari" at Rakuten tech talk
"erlang, webmail and hibari" at Rakuten tech talk"erlang, webmail and hibari" at Rakuten tech talk
"erlang, webmail and hibari" at Rakuten tech talk
 
Deluxe techperl
Deluxe techperlDeluxe techperl
Deluxe techperl
 
Running Tensorflow In Production: Challenges and Solutions on YARN 3.x
Running Tensorflow In Production: Challenges and Solutions on YARN 3.x Running Tensorflow In Production: Challenges and Solutions on YARN 3.x
Running Tensorflow In Production: Challenges and Solutions on YARN 3.x
 
EMC Unified Analytics Platform. Gintaras Pelenis
EMC Unified Analytics Platform. Gintaras PelenisEMC Unified Analytics Platform. Gintaras Pelenis
EMC Unified Analytics Platform. Gintaras Pelenis
 
Real World Elixir Deployment
Real World Elixir DeploymentReal World Elixir Deployment
Real World Elixir Deployment
 
Redefine Big Data
Redefine Big DataRedefine Big Data
Redefine Big Data
 
Erlang and Scalability
Erlang and ScalabilityErlang and Scalability
Erlang and Scalability
 
Repeating History...On Purpose...with Elixir
Repeating History...On Purpose...with ElixirRepeating History...On Purpose...with Elixir
Repeating History...On Purpose...with Elixir
 
Openerp Rise Web
Openerp Rise WebOpenerp Rise Web
Openerp Rise Web
 
TDC2016SP - Trilha Programação Funcional
TDC2016SP - Trilha Programação FuncionalTDC2016SP - Trilha Programação Funcional
TDC2016SP - Trilha Programação Funcional
 
Erlang sem enrolação
Erlang sem enrolaçãoErlang sem enrolação
Erlang sem enrolação
 
OpenMp
OpenMpOpenMp
OpenMp
 
z13: New Opportunities – if you dare!
z13: New Opportunities – if you dare!z13: New Opportunities – if you dare!
z13: New Opportunities – if you dare!
 
XPDS14: Unikernels: Who, What, Where, When, Why - Adam Wick, Galois
XPDS14: Unikernels: Who, What, Where, When, Why - Adam Wick, GaloisXPDS14: Unikernels: Who, What, Where, When, Why - Adam Wick, Galois
XPDS14: Unikernels: Who, What, Where, When, Why - Adam Wick, Galois
 
Drive User Adoption And Productivity Using Crm Within Microsoft Outlook
Drive User Adoption And Productivity Using Crm Within Microsoft OutlookDrive User Adoption And Productivity Using Crm Within Microsoft Outlook
Drive User Adoption And Productivity Using Crm Within Microsoft Outlook
 
Wherefore art thou Erlang?, OW2con'18, June 7-8, 2018, Paris
Wherefore art thou Erlang?, OW2con'18, June 7-8, 2018, ParisWherefore art thou Erlang?, OW2con'18, June 7-8, 2018, Paris
Wherefore art thou Erlang?, OW2con'18, June 7-8, 2018, Paris
 
Elixir
ElixirElixir
Elixir
 
Beam me up, Scotty
Beam me up, ScottyBeam me up, Scotty
Beam me up, Scotty
 

More from Ontico

One-cloud — система управления дата-центром в Одноклассниках / Олег Анастасье...
One-cloud — система управления дата-центром в Одноклассниках / Олег Анастасье...One-cloud — система управления дата-центром в Одноклассниках / Олег Анастасье...
One-cloud — система управления дата-центром в Одноклассниках / Олег Анастасье...Ontico
 
Масштабируя DNS / Артем Гавриченков (Qrator Labs)
Масштабируя DNS / Артем Гавриченков (Qrator Labs)Масштабируя DNS / Артем Гавриченков (Qrator Labs)
Масштабируя DNS / Артем Гавриченков (Qrator Labs)Ontico
 
Создание BigData-платформы для ФГУП Почта России / Андрей Бащенко (Luxoft)
Создание BigData-платформы для ФГУП Почта России / Андрей Бащенко (Luxoft)Создание BigData-платформы для ФГУП Почта России / Андрей Бащенко (Luxoft)
Создание BigData-платформы для ФГУП Почта России / Андрей Бащенко (Luxoft)Ontico
 
Готовим тестовое окружение, или сколько тестовых инстансов вам нужно / Алекса...
Готовим тестовое окружение, или сколько тестовых инстансов вам нужно / Алекса...Готовим тестовое окружение, или сколько тестовых инстансов вам нужно / Алекса...
Готовим тестовое окружение, или сколько тестовых инстансов вам нужно / Алекса...Ontico
 
Новые технологии репликации данных в PostgreSQL / Александр Алексеев (Postgre...
Новые технологии репликации данных в PostgreSQL / Александр Алексеев (Postgre...Новые технологии репликации данных в PostgreSQL / Александр Алексеев (Postgre...
Новые технологии репликации данных в PostgreSQL / Александр Алексеев (Postgre...Ontico
 
PostgreSQL Configuration for Humans / Alvaro Hernandez (OnGres)
PostgreSQL Configuration for Humans / Alvaro Hernandez (OnGres)PostgreSQL Configuration for Humans / Alvaro Hernandez (OnGres)
PostgreSQL Configuration for Humans / Alvaro Hernandez (OnGres)Ontico
 
Inexpensive Datamasking for MySQL with ProxySQL — Data Anonymization for Deve...
Inexpensive Datamasking for MySQL with ProxySQL — Data Anonymization for Deve...Inexpensive Datamasking for MySQL with ProxySQL — Data Anonymization for Deve...
Inexpensive Datamasking for MySQL with ProxySQL — Data Anonymization for Deve...Ontico
 
Опыт разработки модуля межсетевого экранирования для MySQL / Олег Брославский...
Опыт разработки модуля межсетевого экранирования для MySQL / Олег Брославский...Опыт разработки модуля межсетевого экранирования для MySQL / Олег Брославский...
Опыт разработки модуля межсетевого экранирования для MySQL / Олег Брославский...Ontico
 
ProxySQL Use Case Scenarios / Alkin Tezuysal (Percona)
ProxySQL Use Case Scenarios / Alkin Tezuysal (Percona)ProxySQL Use Case Scenarios / Alkin Tezuysal (Percona)
ProxySQL Use Case Scenarios / Alkin Tezuysal (Percona)Ontico
 
MySQL Replication — Advanced Features / Петр Зайцев (Percona)
MySQL Replication — Advanced Features / Петр Зайцев (Percona)MySQL Replication — Advanced Features / Петр Зайцев (Percona)
MySQL Replication — Advanced Features / Петр Зайцев (Percona)Ontico
 
Внутренний open-source. Как разрабатывать мобильное приложение большим количе...
Внутренний open-source. Как разрабатывать мобильное приложение большим количе...Внутренний open-source. Как разрабатывать мобильное приложение большим количе...
Внутренний open-source. Как разрабатывать мобильное приложение большим количе...Ontico
 
Подробно о том, как Causal Consistency реализовано в MongoDB / Михаил Тюленев...
Подробно о том, как Causal Consistency реализовано в MongoDB / Михаил Тюленев...Подробно о том, как Causal Consistency реализовано в MongoDB / Михаил Тюленев...
Подробно о том, как Causal Consistency реализовано в MongoDB / Михаил Тюленев...Ontico
 
Балансировка на скорости проводов. Без ASIC, без ограничений. Решения NFWare ...
Балансировка на скорости проводов. Без ASIC, без ограничений. Решения NFWare ...Балансировка на скорости проводов. Без ASIC, без ограничений. Решения NFWare ...
Балансировка на скорости проводов. Без ASIC, без ограничений. Решения NFWare ...Ontico
 
Перехват трафика — мифы и реальность / Евгений Усков (Qrator Labs)
Перехват трафика — мифы и реальность / Евгений Усков (Qrator Labs)Перехват трафика — мифы и реальность / Евгений Усков (Qrator Labs)
Перехват трафика — мифы и реальность / Евгений Усков (Qrator Labs)Ontico
 
И тогда наверняка вдруг запляшут облака! / Алексей Сушков (ПЕТЕР-СЕРВИС)
И тогда наверняка вдруг запляшут облака! / Алексей Сушков (ПЕТЕР-СЕРВИС)И тогда наверняка вдруг запляшут облака! / Алексей Сушков (ПЕТЕР-СЕРВИС)
И тогда наверняка вдруг запляшут облака! / Алексей Сушков (ПЕТЕР-СЕРВИС)Ontico
 
Как мы заставили Druid работать в Одноклассниках / Юрий Невиницин (OK.RU)
Как мы заставили Druid работать в Одноклассниках / Юрий Невиницин (OK.RU)Как мы заставили Druid работать в Одноклассниках / Юрий Невиницин (OK.RU)
Как мы заставили Druid работать в Одноклассниках / Юрий Невиницин (OK.RU)Ontico
 
Разгоняем ASP.NET Core / Илья Вербицкий (WebStoating s.r.o.)
Разгоняем ASP.NET Core / Илья Вербицкий (WebStoating s.r.o.)Разгоняем ASP.NET Core / Илья Вербицкий (WebStoating s.r.o.)
Разгоняем ASP.NET Core / Илья Вербицкий (WebStoating s.r.o.)Ontico
 
100500 способов кэширования в Oracle Database или как достичь максимальной ск...
100500 способов кэширования в Oracle Database или как достичь максимальной ск...100500 способов кэширования в Oracle Database или как достичь максимальной ск...
100500 способов кэширования в Oracle Database или как достичь максимальной ск...Ontico
 
Apache Ignite Persistence: зачем Persistence для In-Memory, и как он работает...
Apache Ignite Persistence: зачем Persistence для In-Memory, и как он работает...Apache Ignite Persistence: зачем Persistence для In-Memory, и как он работает...
Apache Ignite Persistence: зачем Persistence для In-Memory, и как он работает...Ontico
 
Механизмы мониторинга баз данных: взгляд изнутри / Дмитрий Еманов (Firebird P...
Механизмы мониторинга баз данных: взгляд изнутри / Дмитрий Еманов (Firebird P...Механизмы мониторинга баз данных: взгляд изнутри / Дмитрий Еманов (Firebird P...
Механизмы мониторинга баз данных: взгляд изнутри / Дмитрий Еманов (Firebird P...Ontico
 

More from Ontico (20)

One-cloud — система управления дата-центром в Одноклассниках / Олег Анастасье...
One-cloud — система управления дата-центром в Одноклассниках / Олег Анастасье...One-cloud — система управления дата-центром в Одноклассниках / Олег Анастасье...
One-cloud — система управления дата-центром в Одноклассниках / Олег Анастасье...
 
Масштабируя DNS / Артем Гавриченков (Qrator Labs)
Масштабируя DNS / Артем Гавриченков (Qrator Labs)Масштабируя DNS / Артем Гавриченков (Qrator Labs)
Масштабируя DNS / Артем Гавриченков (Qrator Labs)
 
Создание BigData-платформы для ФГУП Почта России / Андрей Бащенко (Luxoft)
Создание BigData-платформы для ФГУП Почта России / Андрей Бащенко (Luxoft)Создание BigData-платформы для ФГУП Почта России / Андрей Бащенко (Luxoft)
Создание BigData-платформы для ФГУП Почта России / Андрей Бащенко (Luxoft)
 
Готовим тестовое окружение, или сколько тестовых инстансов вам нужно / Алекса...
Готовим тестовое окружение, или сколько тестовых инстансов вам нужно / Алекса...Готовим тестовое окружение, или сколько тестовых инстансов вам нужно / Алекса...
Готовим тестовое окружение, или сколько тестовых инстансов вам нужно / Алекса...
 
Новые технологии репликации данных в PostgreSQL / Александр Алексеев (Postgre...
Новые технологии репликации данных в PostgreSQL / Александр Алексеев (Postgre...Новые технологии репликации данных в PostgreSQL / Александр Алексеев (Postgre...
Новые технологии репликации данных в PostgreSQL / Александр Алексеев (Postgre...
 
PostgreSQL Configuration for Humans / Alvaro Hernandez (OnGres)
PostgreSQL Configuration for Humans / Alvaro Hernandez (OnGres)PostgreSQL Configuration for Humans / Alvaro Hernandez (OnGres)
PostgreSQL Configuration for Humans / Alvaro Hernandez (OnGres)
 
Inexpensive Datamasking for MySQL with ProxySQL — Data Anonymization for Deve...
Inexpensive Datamasking for MySQL with ProxySQL — Data Anonymization for Deve...Inexpensive Datamasking for MySQL with ProxySQL — Data Anonymization for Deve...
Inexpensive Datamasking for MySQL with ProxySQL — Data Anonymization for Deve...
 
Опыт разработки модуля межсетевого экранирования для MySQL / Олег Брославский...
Опыт разработки модуля межсетевого экранирования для MySQL / Олег Брославский...Опыт разработки модуля межсетевого экранирования для MySQL / Олег Брославский...
Опыт разработки модуля межсетевого экранирования для MySQL / Олег Брославский...
 
ProxySQL Use Case Scenarios / Alkin Tezuysal (Percona)
ProxySQL Use Case Scenarios / Alkin Tezuysal (Percona)ProxySQL Use Case Scenarios / Alkin Tezuysal (Percona)
ProxySQL Use Case Scenarios / Alkin Tezuysal (Percona)
 
MySQL Replication — Advanced Features / Петр Зайцев (Percona)
MySQL Replication — Advanced Features / Петр Зайцев (Percona)MySQL Replication — Advanced Features / Петр Зайцев (Percona)
MySQL Replication — Advanced Features / Петр Зайцев (Percona)
 
Внутренний open-source. Как разрабатывать мобильное приложение большим количе...
Внутренний open-source. Как разрабатывать мобильное приложение большим количе...Внутренний open-source. Как разрабатывать мобильное приложение большим количе...
Внутренний open-source. Как разрабатывать мобильное приложение большим количе...
 
Подробно о том, как Causal Consistency реализовано в MongoDB / Михаил Тюленев...
Подробно о том, как Causal Consistency реализовано в MongoDB / Михаил Тюленев...Подробно о том, как Causal Consistency реализовано в MongoDB / Михаил Тюленев...
Подробно о том, как Causal Consistency реализовано в MongoDB / Михаил Тюленев...
 
Балансировка на скорости проводов. Без ASIC, без ограничений. Решения NFWare ...
Балансировка на скорости проводов. Без ASIC, без ограничений. Решения NFWare ...Балансировка на скорости проводов. Без ASIC, без ограничений. Решения NFWare ...
Балансировка на скорости проводов. Без ASIC, без ограничений. Решения NFWare ...
 
Перехват трафика — мифы и реальность / Евгений Усков (Qrator Labs)
Перехват трафика — мифы и реальность / Евгений Усков (Qrator Labs)Перехват трафика — мифы и реальность / Евгений Усков (Qrator Labs)
Перехват трафика — мифы и реальность / Евгений Усков (Qrator Labs)
 
И тогда наверняка вдруг запляшут облака! / Алексей Сушков (ПЕТЕР-СЕРВИС)
И тогда наверняка вдруг запляшут облака! / Алексей Сушков (ПЕТЕР-СЕРВИС)И тогда наверняка вдруг запляшут облака! / Алексей Сушков (ПЕТЕР-СЕРВИС)
И тогда наверняка вдруг запляшут облака! / Алексей Сушков (ПЕТЕР-СЕРВИС)
 
Как мы заставили Druid работать в Одноклассниках / Юрий Невиницин (OK.RU)
Как мы заставили Druid работать в Одноклассниках / Юрий Невиницин (OK.RU)Как мы заставили Druid работать в Одноклассниках / Юрий Невиницин (OK.RU)
Как мы заставили Druid работать в Одноклассниках / Юрий Невиницин (OK.RU)
 
Разгоняем ASP.NET Core / Илья Вербицкий (WebStoating s.r.o.)
Разгоняем ASP.NET Core / Илья Вербицкий (WebStoating s.r.o.)Разгоняем ASP.NET Core / Илья Вербицкий (WebStoating s.r.o.)
Разгоняем ASP.NET Core / Илья Вербицкий (WebStoating s.r.o.)
 
100500 способов кэширования в Oracle Database или как достичь максимальной ск...
100500 способов кэширования в Oracle Database или как достичь максимальной ск...100500 способов кэширования в Oracle Database или как достичь максимальной ск...
100500 способов кэширования в Oracle Database или как достичь максимальной ск...
 
Apache Ignite Persistence: зачем Persistence для In-Memory, и как он работает...
Apache Ignite Persistence: зачем Persistence для In-Memory, и как он работает...Apache Ignite Persistence: зачем Persistence для In-Memory, и как он работает...
Apache Ignite Persistence: зачем Persistence для In-Memory, и как он работает...
 
Механизмы мониторинга баз данных: взгляд изнутри / Дмитрий Еманов (Firebird P...
Механизмы мониторинга баз данных: взгляд изнутри / Дмитрий Еманов (Firebird P...Механизмы мониторинга баз данных: взгляд изнутри / Дмитрий Еманов (Firebird P...
Механизмы мониторинга баз данных: взгляд изнутри / Дмитрий Еманов (Firebird P...
 

Recently uploaded

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
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Allon Mureinik
 
Developing An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of BrazilDeveloping An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of BrazilV3cube
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024Rafal Los
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesSinan KOZAK
 
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
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processorsdebabhi2
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityPrincipled Technologies
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking MenDelhi Call girls
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdfhans926745
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Enterprise Knowledge
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsMaria Levchenko
 
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
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxKatpro Technologies
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Igalia
 
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
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j
 

Recently uploaded (20)

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...
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)
 
Developing An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of BrazilDeveloping An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of Brazil
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen Frames
 
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
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
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
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
 
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
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
 

The design and implementation of a scalable concurrent virtual machine (Robert Virding)

  • 1. Robert Virding Principle Language Expert at Erlang Solutions Ltd. Erlang Solutions Ltd. The Design and Implementation of a Scalable, Concurrent Virtual Machine © 1999-2011 Erlang Solutions Ltd.
  • 2. Erlang Solutions Ltd. • The one stop shop for all your Erlang needs • Founded in 1999, Offices in UK, Sweden and Poland • Clients on six continents • System development experience in: - Telecom, banking, e-commerce, track & trace, VOIP, etc. • We do: - In-house system development, on-site consultancy, and contracting, - Erlang-based recruitment and Professional training at all levels © 1999-2011 Erlang Solutions Ltd. 2
  • 3. Concurrency vs. Parallelism • Parallelism is what the system provides • Concurrency is a property of the problem/ solution (as good a definition as any) © 1999-2011 Erlang Solutions Ltd. 3
  • 4. Erlang is COP Concurrency Oriented Programming © 1999-2011 Erlang Solutions Ltd. 4
  • 5. Problem domain/Erlang properties • Light-weight concurrency • Asynchronous message passing • Process isolation • Error handling • Complex coordination • Soft real-time • Continuous evolution of system © 1999-2011 Erlang Solutions Ltd. 5
  • 6. Erlang is a functional language • Immutable data • No looping constructs • Pattern matching is ubiquitous © 1999-2011 Erlang Solutions Ltd. 6
  • 7. Communication • Asynchronous message passing - Scales well - Suits multi-core - needs only limited synchronisation • Each process has a single message queue • Selective receive • Suitable as a building block © 1999-2011 Erlang Solutions Ltd. 7
  • 8. The BEAM The main Erlang implementation Will cover: • Processes/scheduling • Memory management • Communication • Error handling (Bogdan’s Erlang Abstract Machine, now Björn’s) © 1999-2011 Erlang Solutions Ltd. 8
  • 9. Processes and scheduling • Want light-weight concurency • Must have processes (isolation) ➡Implement processes ourselves (green processes) • They are really light-weight • Complete control of scheduling • Not a general machine © 1999-2011 Erlang Solutions Ltd. 9
  • 10. Processes and scheduling • Pre-emptive scheduling - Scheduled as cooperating coroutines • One run-queue per thread • Multi-core/multi-thread ➡ multi-queues - Process stealing • No really viable alternatives © 1999-2011 Erlang Solutions Ltd. 10
  • 11. Memory management/GC • Soft real-time requires unobtrusive GC • Must ensure process isolation • Stop-the-world collector vs. interactive/concurrent collector - independent of parallelism © 1999-2011 Erlang Solutions Ltd. 11
  • 12. Memory management/GC Alternatives: • Shared heap • Separate process heaps • Hybrid © 1999-2011 Erlang Solutions Ltd. 12
  • 13. Memory management/GC Erlang does NOT require separate heaps and message copying! • Immutable data means we can safely share © 1999-2011 Erlang Solutions Ltd. 13
  • 14. Memory management/GC Shared heap • Reduces copying of data - Messages shared • Complicates GC - must use incremental/concurrent collector • Less well-suited to multi-core • Complicates handling of processes © 1999-2011 Erlang Solutions Ltd. 14
  • 15. Memory management/GC Separate process heaps • Increases copying of data - messages copied • Simplifies GC - can use stop-the-world per process collector • Fits well on multi-core • Scales well • Simplifies handling of processes © 1999-2011 Erlang Solutions Ltd. 15
  • 16. Memory management/GC Hybrid heaps • Reduces copying of data - messages on shared heap • May in part be determined at compile-time • Complicates GC • Less well-suited on multi-core © 1999-2011 Erlang Solutions Ltd. 16
  • 17. Memory management/GC Erlang BEAM uses very restricted hybrid heaps • Mainly separate heaps - most of the benefits of separate heaps • Some shared data - get some benefits of shared data - without too many of the complications © 1999-2011 Erlang Solutions Ltd. 17
  • 18. Alternative communication • Share memory communication - synchronisation woes - locking, mutexes ... - scalability? - error handling • STM (Software Transactional Memory) - scalability? • Go concurrency motto - "Do not communicate by sharing memory; instead, share memory by communicating" © 1999-2011 Erlang Solutions Ltd. 18
  • 19. Erjang - Erlang on the JVM A real Erlang on the JVM Will cover: • Why the JVM? • How it runs Erlang code • Concurrency/scheduling • Memory management/GC • Miscellaneous © 1999-2011 Erlang Solutions Ltd. 19
  • 20. Erjang - Why the JVM? • Erjang is different from the BEAM - it has different properties • Very mature VM • Wide-spread VM - Erlang can run in MANY more places • Improved interface between Erlang and other JVM languages • Access to libraries (Kresten wanted to learn Erlang) © 1999-2011 Erlang Solutions Ltd. 20
  • 21. Erjang - Running Erlang code • Uses BEAM VM assembler code as source to generate Java .class files - helps ensure compatibility © 1999-2011 Erlang Solutions Ltd. 21
  • 22. Erjang - Concurrency • Uses Kilim to provide concurrency and message passing - ultra light-weight threads - message passing with shared messages • Cooperative coroutines © 1999-2011 Erlang Solutions Ltd. 22
  • 23. Erjang - Scheduling • Pre-emptive scheduling - Scheduled as cooperating coroutines • One run-queue per thread • Multi-core/multi-thread ➡ multi-queues © 1999-2011 Erlang Solutions Ltd. 23
  • 24. Erjang - Memory management/GC • Uses standard JVM memory management/GC - shared heap - stop-the-world collector ➡Cannot guarantee soft real-time behaviour (yet) ☹ © 1999-2011 Erlang Solutions Ltd. 24
  • 25. Erjang - Miscellaneous • Needs special handling for tail-call optimisation (a must for functional languages) - BEAM compiler generates different calls - two entry points for each function - common body © 1999-2011 Erlang Solutions Ltd. 25
  • 26. The Erlang User Conference brings together the best minds and names in Erlang Programming • This year, the Erlang User Conference will be held in a brand new location – the exciting, spacious building of the München Bryggeriet. • An enticing addition to the 2011 conference will be two further tracks. • We will also be holding a day of tutorials on 4 November. • In the 3 days prior to the conference, 31 October – 2 November, we will be holding an Erlang University with a selection of Erlang courses suitable for all levels of expertise. © 1999-2011 Erlang Solutions Ltd. 26
  • 27. Questions? Thank you Robert Virding robert.virding@erlang-solutions.com © 1999-2011 Erlang Solutions Ltd. 27