SlideShare uma empresa Scribd logo
1 de 26
KILLER features of the
BEAM
And what makes the BEAM a unique and powerful tool that
really stands out!
InfoQ.com: News & Community Site
Watch the video with slide
synchronization on InfoQ.com!
https://www.infoq.com/presentations/
resilience-beam-erlang-otp/
• Over 1,000,000 software developers, architects and CTOs read the site world-
wide every month
• 250,000 senior developers subscribe to our weekly newsletter
• Published in 4 languages (English, Chinese, Japanese and Brazilian
Portuguese)
• Post content from our QCon conferences
• 2 dedicated podcast channels: The InfoQ Podcast, with a focus on
Architecture and The Engineering Culture Podcast, with a focus on building
• 96 deep dives on innovative topics packed as downloadable emags and
minibooks
• Over 40 new content items per week
Purpose of QCon
- to empower software development by facilitating the spread of
knowledge and innovation
Strategy
- practitioner-driven conference designed for YOU: influencers of
change and innovation in your teams
- speakers and topics driving the evolution and innovation
- connecting and catalyzing the influencers and innovators
Highlights
- attended by more than 12,000 delegates since 2007
- held in 9 cities worldwide
Presented at QCon London
www.qconlondon.com
Actor Model
Hundreds, Thousands, Millions of processes…
System limit can be between1,024-134,217,727
They share NOTHING
Communicate through message passing
Demo 1
A hypothetical server
accept(NumRequests)->
[dispatch(Req, self()) || Req <- lists:seq(1, NumRequests)],
collect_responses(0, 0, 0, 0, NumRequests).
accept_loop() ->
receive %% to get a message in my mailbox
Req -> dispatch(Req, self()) %% self() = my process id
end,
accept_loop().
JUGGLER
a simplified DEMO SERVER
https://github.com/iguberman/erljuggler_demo
lists:seq(1, NumRequests)dispatch(Req, self())
dispatch(Req, AcceptorPid) ->
spawn(
?MODULE, %% Module
kick_off_request_handler, %% Function
[Req, AcceptorPid]). %% Arguments
kick_off_request_handler
%%% a kind of a supervisor
kick_off_request_handler(Req, AcceptorPid) ->
RequestHandlerPid =
spawn(?MODULE, handle_request, [Req, self()]),
kick_off_request_handler
{RequestHandlerPid, Resp} ->
Unexpected ->
AcceptorPid ! {error, Unexpected}
Start = os:system_time(millisecond),
receive
end.
handle_request
End = os:system_time(millisecond),
Duration = End - Start,
io:format("...~p [~b]...", [Req, Duration]),
AcceptorPid ! {RequestHandlerPid, Resp, Duration};
JUGGLER
a simplified DEMO SERVER
https://github.com/iguberman/erljuggler_demo
handle_request
JUGGLER
a simplified DEMO SERVER
https://github.com/iguberman/erljuggler_demo
handle_request(Req, ParentPid) when is_integer(Req) ->
Resp = count_to_1000_and_do_other_stuff_too(Req, 0),
HandlerPid = self(),
ParentPid ! {HandlerPid, Resp}
end.
count_to_1000_and_do_other_stuff_too(_Req, 1000) -> ok;
count_to_1000_and_do_other_stuff_too(Req, C) ->
case (Req rem 2) of
0 -> binary:copy(<<Req/integer>>,300);
1 -> binary:copy(<<(Req + 1)/integer>>,200)
end,
count_to_1000_and_do_other_stuff_too(Req, C+1).
Demo 2
server with a bug
JUGGLER
a simplified DEMO SERVER
https://github.com/iguberman/erljuggler_demo
handle_request(Req, ParentPid) when is_integer(Req) ->
Resp = count_to_1000_and_do_other_stuff_too(Req, 0),
HandlerPid = self(),
ParentPid ! {HandlerPid, Resp}
end.
end.
case Req rem 100 of
0 ->
io:format("~n**** ~p [INF]*****~n", [Req]),
ParentPid ! dont_wait_for_me,
handle_with_inf_loop_bug();
_Other ->
handle_with_inf_loop_bug()->
infinite_loop(0).
infinite_loop(C) ->
_A = binary:copy(<<1>>,200),
_B = math:sqrt(1235),
infinite_loop(C+1).
BEAM Scheduler
Preemptive?
Cooperative?
Cooperative at C level
Preemptive at Erlang level
(by means of reduction counting)
2000 reductions
Reduction ~= function call
Word of caution: BIFs and NIFs
Free
BEAM Memory model
Process
PCB Stack
HeapMBox
GC
hipe_bifs:show_heap(Pid).
hipe_bifs:show_pcb(Pid). %% Look at heap_sz !
hipe_bifs:show_estack(Pid).
Old Heap
JVM
(simplified! SORRY! )
Heap
Thread
Thread
ThreadThreadThread
Thread
Thread
Thread
Thread
Thread
Thread
Thread
Thread
Thread
Thread
Thread
Thread
Thread
Thread
Thread
Thread
Thread
Thread
Thread
Thread
Thread
Thread
Stop the world.
Is that a thing in Erlang?
GC
DEMO 3
The KILLER
%%% a kind of a supervisor
kick_off_request_handler(Req, AcceptorPid) ->
RequestHandlerPid =
spawn(?MODULE, handle_request, [Req, self()]),
{RequestHandlerPid, Resp} ->
Start = os:system_time(millisecond),
receive
end.
End = os:system_time(millisecond),
Duration = End - Start,
io:format("...~p [~b]...", [Req, Duration]),
AcceptorPid ! {RequestHandlerPid, Resp, Duration};
KILLER_JUGGLER
a simplified DEMO SERVER
https://github.com/iguberman/erljuggler_demo
after 5000 ->
exit(HandlerPid, timedout),
AcceptorPid ! {HandlerPid, killed}
Other -> AcceptorPid ! {error, Other}
STACK
BASED
More Instructions
REGISTER
BASED
Instructions are simple
Fewer instructions
Instructions have more info
1.POP 20
2.POP 7
3.ADD 20, 7, result
4.PUSH result
1. ADD R1, R2, R3 ;
# Add contents of R1 and R2, store result in R3
Performance Survey on
Stack-based and Register-
based VirtualMachines
Ruijie Fang, Siqi Liu, 2016
VM feature comparisons:
Scientific comparison of REGISTER (Erlang) vs. STACK (JVM) VM
Inertia spends 66.42% less time in instruction dispatch than Conceptum, on average
However, Inertia is still slower
in the overall fetch time, spending 23.5% more time on average in fetching operands than Conceptum does
Based on our test results, stack-based virtual machines
typically perform better on benchmarks featuring a high amount of arithmetic operations.
In contrast to the stack-based virtual machine’s
performance, the register-based virtual machine performed much better on recursions and memory operations.
CONCEPTUM
(stack-based like JVM)
INERTIA
(register-based like BEAM)
MBox
PCB Stack
Heap
M-buf
Free
M-buf M-buf M-buf
MBox Intern
MBox Inbox
Old Heap
DEMO 4
Bring it down by sending messages to the
process affected by inf loop!
TYPE SYSTEM
Strong typed.
So every type has a tag.
Dynamically typed.
Hot code loading anyone?
TAGGING
In the memory representation of an Erlang term a few bits are
reserved for a type tag.
LEVEL 1 tags:
00 Header (on heap) CP (on stack)
01 List (cons)
10 Boxed
11 Immediate
LEVEL 2 tags (Immediate):
00 11 Pid
01 11 Port
10 11 Immediate 2
11 11 Small integer
<- pointers to the heap
<- fit into one word on the stack
LEVEL 3 tags (Immediate 2):
00 10 11 Atom
01 10 11 Catch
10 10 11 [UNUSED]
11 10 11 Nil <- for empty list []
Q. How is cooperative scheduling implemented?
A. If there are untagged values —
no preempting
https://happi.github.io/theBeamBook
https://www.researchgate.net/publication/
309631798_A_Performance_Survey_on_Stack-
based_and_Register-based_Virtual_Machines (pdf available)
https://llvm.org/devmtg/2014-04/PDFs/Talks/drejhammar.pdf
REFERENCES
https://markfaction.wordpress.com/2012/07/15/stack-based-vs-register-
based-virtual-machine-architecture-and-the-dalvik-vm/
Watch the video with slide
synchronization on InfoQ.com!
https://www.infoq.com/presentations/
resilience-beam-erlang-otp/

Mais conteúdo relacionado

Mais de C4Media

Mais de C4Media (20)

Shifting Left with Cloud Native CI/CD
Shifting Left with Cloud Native CI/CDShifting Left with Cloud Native CI/CD
Shifting Left with Cloud Native CI/CD
 
CI/CD for Machine Learning
CI/CD for Machine LearningCI/CD for Machine Learning
CI/CD for Machine Learning
 
Fault Tolerance at Speed
Fault Tolerance at SpeedFault Tolerance at Speed
Fault Tolerance at Speed
 
Architectures That Scale Deep - Regaining Control in Deep Systems
Architectures That Scale Deep - Regaining Control in Deep SystemsArchitectures That Scale Deep - Regaining Control in Deep Systems
Architectures That Scale Deep - Regaining Control in Deep Systems
 
ML in the Browser: Interactive Experiences with Tensorflow.js
ML in the Browser: Interactive Experiences with Tensorflow.jsML in the Browser: Interactive Experiences with Tensorflow.js
ML in the Browser: Interactive Experiences with Tensorflow.js
 
Build Your Own WebAssembly Compiler
Build Your Own WebAssembly CompilerBuild Your Own WebAssembly Compiler
Build Your Own WebAssembly Compiler
 
User & Device Identity for Microservices @ Netflix Scale
User & Device Identity for Microservices @ Netflix ScaleUser & Device Identity for Microservices @ Netflix Scale
User & Device Identity for Microservices @ Netflix Scale
 
Scaling Patterns for Netflix's Edge
Scaling Patterns for Netflix's EdgeScaling Patterns for Netflix's Edge
Scaling Patterns for Netflix's Edge
 
Make Your Electron App Feel at Home Everywhere
Make Your Electron App Feel at Home EverywhereMake Your Electron App Feel at Home Everywhere
Make Your Electron App Feel at Home Everywhere
 
The Talk You've Been Await-ing For
The Talk You've Been Await-ing ForThe Talk You've Been Await-ing For
The Talk You've Been Await-ing For
 
Future of Data Engineering
Future of Data EngineeringFuture of Data Engineering
Future of Data Engineering
 
Automated Testing for Terraform, Docker, Packer, Kubernetes, and More
Automated Testing for Terraform, Docker, Packer, Kubernetes, and MoreAutomated Testing for Terraform, Docker, Packer, Kubernetes, and More
Automated Testing for Terraform, Docker, Packer, Kubernetes, and More
 
Navigating Complexity: High-performance Delivery and Discovery Teams
Navigating Complexity: High-performance Delivery and Discovery TeamsNavigating Complexity: High-performance Delivery and Discovery Teams
Navigating Complexity: High-performance Delivery and Discovery Teams
 
High Performance Cooperative Distributed Systems in Adtech
High Performance Cooperative Distributed Systems in AdtechHigh Performance Cooperative Distributed Systems in Adtech
High Performance Cooperative Distributed Systems in Adtech
 
Rust's Journey to Async/await
Rust's Journey to Async/awaitRust's Journey to Async/await
Rust's Journey to Async/await
 
Opportunities and Pitfalls of Event-Driven Utopia
Opportunities and Pitfalls of Event-Driven UtopiaOpportunities and Pitfalls of Event-Driven Utopia
Opportunities and Pitfalls of Event-Driven Utopia
 
Datadog: a Real-Time Metrics Database for One Quadrillion Points/Day
Datadog: a Real-Time Metrics Database for One Quadrillion Points/DayDatadog: a Real-Time Metrics Database for One Quadrillion Points/Day
Datadog: a Real-Time Metrics Database for One Quadrillion Points/Day
 
Are We Really Cloud-Native?
Are We Really Cloud-Native?Are We Really Cloud-Native?
Are We Really Cloud-Native?
 
CockroachDB: Architecture of a Geo-Distributed SQL Database
CockroachDB: Architecture of a Geo-Distributed SQL DatabaseCockroachDB: Architecture of a Geo-Distributed SQL Database
CockroachDB: Architecture of a Geo-Distributed SQL Database
 
A Dive into Streams @LinkedIn with Brooklin
A Dive into Streams @LinkedIn with BrooklinA Dive into Streams @LinkedIn with Brooklin
A Dive into Streams @LinkedIn with Brooklin
 

Último

Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
WSO2
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
panagenda
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Safe Software
 

Último (20)

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
 
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...
 
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
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
 
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbu
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu SubbuApidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbu
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbu
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...
Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...
Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...
 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
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...
 
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
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdf
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
ICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesICT role in 21st century education and its challenges
ICT role in 21st century education and its challenges
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
 
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?
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 

Unique Resiliency of the Erlang VM, the BEAM and Erlang OTP

  • 1. KILLER features of the BEAM And what makes the BEAM a unique and powerful tool that really stands out!
  • 2. InfoQ.com: News & Community Site Watch the video with slide synchronization on InfoQ.com! https://www.infoq.com/presentations/ resilience-beam-erlang-otp/ • Over 1,000,000 software developers, architects and CTOs read the site world- wide every month • 250,000 senior developers subscribe to our weekly newsletter • Published in 4 languages (English, Chinese, Japanese and Brazilian Portuguese) • Post content from our QCon conferences • 2 dedicated podcast channels: The InfoQ Podcast, with a focus on Architecture and The Engineering Culture Podcast, with a focus on building • 96 deep dives on innovative topics packed as downloadable emags and minibooks • Over 40 new content items per week
  • 3. Purpose of QCon - to empower software development by facilitating the spread of knowledge and innovation Strategy - practitioner-driven conference designed for YOU: influencers of change and innovation in your teams - speakers and topics driving the evolution and innovation - connecting and catalyzing the influencers and innovators Highlights - attended by more than 12,000 delegates since 2007 - held in 9 cities worldwide Presented at QCon London www.qconlondon.com
  • 4. Actor Model Hundreds, Thousands, Millions of processes… System limit can be between1,024-134,217,727 They share NOTHING Communicate through message passing
  • 6. accept(NumRequests)-> [dispatch(Req, self()) || Req <- lists:seq(1, NumRequests)], collect_responses(0, 0, 0, 0, NumRequests). accept_loop() -> receive %% to get a message in my mailbox Req -> dispatch(Req, self()) %% self() = my process id end, accept_loop(). JUGGLER a simplified DEMO SERVER https://github.com/iguberman/erljuggler_demo lists:seq(1, NumRequests)dispatch(Req, self()) dispatch(Req, AcceptorPid) -> spawn( ?MODULE, %% Module kick_off_request_handler, %% Function [Req, AcceptorPid]). %% Arguments kick_off_request_handler
  • 7. %%% a kind of a supervisor kick_off_request_handler(Req, AcceptorPid) -> RequestHandlerPid = spawn(?MODULE, handle_request, [Req, self()]), kick_off_request_handler {RequestHandlerPid, Resp} -> Unexpected -> AcceptorPid ! {error, Unexpected} Start = os:system_time(millisecond), receive end. handle_request End = os:system_time(millisecond), Duration = End - Start, io:format("...~p [~b]...", [Req, Duration]), AcceptorPid ! {RequestHandlerPid, Resp, Duration}; JUGGLER a simplified DEMO SERVER https://github.com/iguberman/erljuggler_demo
  • 8. handle_request JUGGLER a simplified DEMO SERVER https://github.com/iguberman/erljuggler_demo handle_request(Req, ParentPid) when is_integer(Req) -> Resp = count_to_1000_and_do_other_stuff_too(Req, 0), HandlerPid = self(), ParentPid ! {HandlerPid, Resp} end. count_to_1000_and_do_other_stuff_too(_Req, 1000) -> ok; count_to_1000_and_do_other_stuff_too(Req, C) -> case (Req rem 2) of 0 -> binary:copy(<<Req/integer>>,300); 1 -> binary:copy(<<(Req + 1)/integer>>,200) end, count_to_1000_and_do_other_stuff_too(Req, C+1).
  • 10. JUGGLER a simplified DEMO SERVER https://github.com/iguberman/erljuggler_demo handle_request(Req, ParentPid) when is_integer(Req) -> Resp = count_to_1000_and_do_other_stuff_too(Req, 0), HandlerPid = self(), ParentPid ! {HandlerPid, Resp} end. end. case Req rem 100 of 0 -> io:format("~n**** ~p [INF]*****~n", [Req]), ParentPid ! dont_wait_for_me, handle_with_inf_loop_bug(); _Other -> handle_with_inf_loop_bug()-> infinite_loop(0). infinite_loop(C) -> _A = binary:copy(<<1>>,200), _B = math:sqrt(1235), infinite_loop(C+1).
  • 11. BEAM Scheduler Preemptive? Cooperative? Cooperative at C level Preemptive at Erlang level (by means of reduction counting) 2000 reductions Reduction ~= function call Word of caution: BIFs and NIFs
  • 12. Free BEAM Memory model Process PCB Stack HeapMBox GC hipe_bifs:show_heap(Pid). hipe_bifs:show_pcb(Pid). %% Look at heap_sz ! hipe_bifs:show_estack(Pid). Old Heap
  • 13.
  • 15. Stop the world. Is that a thing in Erlang? GC
  • 17. %%% a kind of a supervisor kick_off_request_handler(Req, AcceptorPid) -> RequestHandlerPid = spawn(?MODULE, handle_request, [Req, self()]), {RequestHandlerPid, Resp} -> Start = os:system_time(millisecond), receive end. End = os:system_time(millisecond), Duration = End - Start, io:format("...~p [~b]...", [Req, Duration]), AcceptorPid ! {RequestHandlerPid, Resp, Duration}; KILLER_JUGGLER a simplified DEMO SERVER https://github.com/iguberman/erljuggler_demo after 5000 -> exit(HandlerPid, timedout), AcceptorPid ! {HandlerPid, killed} Other -> AcceptorPid ! {error, Other}
  • 18. STACK BASED More Instructions REGISTER BASED Instructions are simple Fewer instructions Instructions have more info 1.POP 20 2.POP 7 3.ADD 20, 7, result 4.PUSH result 1. ADD R1, R2, R3 ; # Add contents of R1 and R2, store result in R3
  • 19. Performance Survey on Stack-based and Register- based VirtualMachines Ruijie Fang, Siqi Liu, 2016 VM feature comparisons: Scientific comparison of REGISTER (Erlang) vs. STACK (JVM) VM Inertia spends 66.42% less time in instruction dispatch than Conceptum, on average However, Inertia is still slower in the overall fetch time, spending 23.5% more time on average in fetching operands than Conceptum does Based on our test results, stack-based virtual machines typically perform better on benchmarks featuring a high amount of arithmetic operations. In contrast to the stack-based virtual machine’s performance, the register-based virtual machine performed much better on recursions and memory operations. CONCEPTUM (stack-based like JVM) INERTIA (register-based like BEAM)
  • 20. MBox PCB Stack Heap M-buf Free M-buf M-buf M-buf MBox Intern MBox Inbox Old Heap
  • 21. DEMO 4 Bring it down by sending messages to the process affected by inf loop!
  • 22. TYPE SYSTEM Strong typed. So every type has a tag. Dynamically typed. Hot code loading anyone?
  • 23. TAGGING In the memory representation of an Erlang term a few bits are reserved for a type tag. LEVEL 1 tags: 00 Header (on heap) CP (on stack) 01 List (cons) 10 Boxed 11 Immediate LEVEL 2 tags (Immediate): 00 11 Pid 01 11 Port 10 11 Immediate 2 11 11 Small integer <- pointers to the heap <- fit into one word on the stack LEVEL 3 tags (Immediate 2): 00 10 11 Atom 01 10 11 Catch 10 10 11 [UNUSED] 11 10 11 Nil <- for empty list []
  • 24. Q. How is cooperative scheduling implemented? A. If there are untagged values — no preempting
  • 26. Watch the video with slide synchronization on InfoQ.com! https://www.infoq.com/presentations/ resilience-beam-erlang-otp/