SlideShare une entreprise Scribd logo
1  sur  24
Télécharger pour lire hors ligne
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
The BEAM
The main Erlang implementation
Will cover:
• Processes/scheduling
• Memory management
• Communication
• Error handling
(Bogdan’s Erlang Abstract Machine)

                  © 1999-2011 Erlang Solutions Ltd.   7
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.   8
Processes and scheduling

• One run-queue per thread
• Scheduled as cooperating coroutines
• Multi-core/multi-thread ➡ multi-queues
   -   Process stealing


• No really viable alternatives


                      © 1999-2011 Erlang Solutions Ltd.   9
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.   10
Memory management/GC
Alternatives:


• Shared heap
• Separate process heaps
• Hybrid
   Erlang does NOT require separate
      heaps and message copying!
                 © 1999-2011 Erlang Solutions Ltd.   11
Memory management/GC

• Shared heap
• Reduces copying of data
• Complicates GC
  -   must use incremental/concurrent collector

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

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

• Separate process heaps
• Increases copying of data
• 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.   13
Memory management/GC

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

• May in part determined at compile-time
• Complicates GC
• Less well-suited on multi-core
• Erlang BEAM uses very restricted hybrid heaps
                   © 1999-2011 Erlang Solutions Ltd.   14
Communication - asynchronous
message passing

• Scales well
• Suits multi-core
  -   needs only limited synchronisation

• Suitable as a building block



                     © 1999-2011 Erlang Solutions Ltd.   15
Erjang - Erlang on the JVM

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

• Wide-spread VM
• Very mature VM
• Improved interface between Erlang and other JVM
  languages
• Access to libraries

(Kresten wanted to learn Erlang)

                   © 1999-2011 Erlang Solutions Ltd.   17
Erjang - Running Erlang code

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




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

• Uses Kilim to provide concurrency and message
  passing
  -   ??description??

• Cooperative coroutines
• Asynchronous message passing



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

• One run-queue per thread
• Scheduled as cooperating coroutines
• Multi-core/multi-thread ➡ multi-queues




                  © 1999-2011 Erlang Solutions Ltd.   20
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.   21
Erjang - Miscellaneous

• Needs special handling for tail-call optimisation
  (a must for functional languages)




                   © 1999-2011 Erlang Solutions Ltd.   22
•   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.                23
Questions?


               Thank you


               Robert Virding
     robert.virding@erlang-solutions.com




               © 1999-2011 Erlang Solutions Ltd.   24

Contenu connexe

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

Embedded erlang-fscons-2010
Embedded erlang-fscons-2010Embedded erlang-fscons-2010
Embedded erlang-fscons-2010
FSCONS
 
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
 

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

Erlang os
Erlang osErlang os
Erlang os
 
A sip of Elixir
A sip of ElixirA sip of Elixir
A sip of Elixir
 
Embedded erlang-fscons-2010
Embedded erlang-fscons-2010Embedded erlang-fscons-2010
Embedded erlang-fscons-2010
 
Thinking in a Highly Concurrent, Mostly-functional Language - Cesarini
Thinking in a Highly Concurrent, Mostly-functional Language - CesariniThinking in a Highly Concurrent, Mostly-functional Language - Cesarini
Thinking in a Highly Concurrent, Mostly-functional Language - Cesarini
 
Erlang workshopdrammen
Erlang workshopdrammenErlang workshopdrammen
Erlang workshopdrammen
 
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
 
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
 
Openerp Rise Web
Openerp Rise WebOpenerp Rise Web
Openerp Rise Web
 
The dream BEAM - A former DevOps perspective
The dream BEAM - A former DevOps perspectiveThe dream BEAM - A former DevOps perspective
The dream BEAM - A former DevOps perspective
 
Real World Elixir Deployment
Real World Elixir DeploymentReal World Elixir Deployment
Real World Elixir Deployment
 
Repeating History...On Purpose...with Elixir
Repeating History...On Purpose...with ElixirRepeating History...On Purpose...with Elixir
Repeating History...On Purpose...with Elixir
 
Erlang and Scalability
Erlang and ScalabilityErlang and Scalability
Erlang and Scalability
 
Building the ideal betting stack | London Erlang User Group presentation
Building the ideal betting stack | London Erlang User Group presentationBuilding the ideal betting stack | London Erlang User Group presentation
Building the ideal betting stack | London Erlang User Group presentation
 
Papyrus for real-time embedded
Papyrus for real-time embeddedPapyrus for real-time embedded
Papyrus for real-time embedded
 
EMC Unified Analytics Platform. Gintaras Pelenis
EMC Unified Analytics Platform. Gintaras PelenisEMC Unified Analytics Platform. Gintaras Pelenis
EMC Unified Analytics Platform. Gintaras Pelenis
 
Redefine Big Data
Redefine Big DataRedefine Big Data
Redefine Big Data
 
The Openflow Soft Switch
The Openflow Soft SwitchThe Openflow Soft Switch
The Openflow Soft Switch
 
MPI, Erlang and the web
MPI, Erlang and the webMPI, Erlang and the web
MPI, Erlang and the web
 

Plus de Ontico

Готовим тестовое окружение, или сколько тестовых инстансов вам нужно / Алекса...
Готовим тестовое окружение, или сколько тестовых инстансов вам нужно / Алекса...Готовим тестовое окружение, или сколько тестовых инстансов вам нужно / Алекса...
Готовим тестовое окружение, или сколько тестовых инстансов вам нужно / Алекса...
Ontico
 

Plus de 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...
 

Dernier

EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
Earley Information Science
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
Enterprise Knowledge
 

Dernier (20)

Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
 
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
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 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
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
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
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 

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. The BEAM The main Erlang implementation Will cover: • Processes/scheduling • Memory management • Communication • Error handling (Bogdan’s Erlang Abstract Machine) © 1999-2011 Erlang Solutions Ltd. 7
  • 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. 8
  • 9. Processes and scheduling • One run-queue per thread • Scheduled as cooperating coroutines • Multi-core/multi-thread ➡ multi-queues - Process stealing • No really viable alternatives © 1999-2011 Erlang Solutions Ltd. 9
  • 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. 10
  • 11. Memory management/GC Alternatives: • Shared heap • Separate process heaps • Hybrid Erlang does NOT require separate heaps and message copying! © 1999-2011 Erlang Solutions Ltd. 11
  • 12. Memory management/GC • Shared heap • Reduces copying of data • Complicates GC - must use incremental/concurrent collector • Less well-suited to multi-core • Complicates handling of processes © 1999-2011 Erlang Solutions Ltd. 12
  • 13. Memory management/GC • Separate process heaps • Increases copying of data • 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. 13
  • 14. Memory management/GC • Hybrid heaps • Reduces copying of data - messages on shared heap • May in part determined at compile-time • Complicates GC • Less well-suited on multi-core • Erlang BEAM uses very restricted hybrid heaps © 1999-2011 Erlang Solutions Ltd. 14
  • 15. Communication - asynchronous message passing • Scales well • Suits multi-core - needs only limited synchronisation • Suitable as a building block © 1999-2011 Erlang Solutions Ltd. 15
  • 16. Erjang - Erlang on the JVM • A real Erlang on the JVM • Will cover: • Why the JVM? • How it runs Erlang code • How it does concurrency • How it does scheduling • Memory management/GC • Miscellaneous © 1999-2011 Erlang Solutions Ltd. 16
  • 17. Erjang - Why the JVM? • Wide-spread VM • Very mature VM • Improved interface between Erlang and other JVM languages • Access to libraries (Kresten wanted to learn Erlang) © 1999-2011 Erlang Solutions Ltd. 17
  • 18. Erjang - Running Erlang code • Uses BEAM VM assembler code as source to generate Java - helps ensure compatibility © 1999-2011 Erlang Solutions Ltd. 18
  • 19. Erjang - Concurrency • Uses Kilim to provide concurrency and message passing - ??description?? • Cooperative coroutines • Asynchronous message passing © 1999-2011 Erlang Solutions Ltd. 19
  • 20. Erjang - Scheduling • One run-queue per thread • Scheduled as cooperating coroutines • Multi-core/multi-thread ➡ multi-queues © 1999-2011 Erlang Solutions Ltd. 20
  • 21. 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. 21
  • 22. Erjang - Miscellaneous • Needs special handling for tail-call optimisation (a must for functional languages) © 1999-2011 Erlang Solutions Ltd. 22
  • 23. 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. 23
  • 24. Questions? Thank you Robert Virding robert.virding@erlang-solutions.com © 1999-2011 Erlang Solutions Ltd. 24