SlideShare a Scribd company logo
elixir for a concurrent world
concurrency
when two or more tasks can start, run, and complete in
overlapping time periods.
os processes
Pros
They have separate sections of memory.
No side effects: If VIM crashes, Chrome is unaffected.
Cons
Unfortunately, expensive...
os threads
Pros
Lighter than OS processes
They do not block each other
They run on separate CPUs, so they are truly parallel
Cons
Still pretty heavy weight
Shared memory
green threads
Threads that are scheduled by a virtual machine, rather than the
OS.
Pros
They don't take up a lot of memory.
Cons
Green thread implementations normally cannot assign work to
multiple processors.
A blocking I/O operation can block all green threads.
so how heavy is "heavy"?
A POSIX thread has a configurable stack size. On my
machine, the default is 8Mb.
JVM, .NET, RubyVM, and CPython all use 1Mb by default.
Therefore, memory usage will add up quickly.
[Erlang] is a concurrent language – by that I mean that
threads are part of the programming language, they do not
belong to the operating system. That's really what's wrong with
programming languages like Java and C++. It's threads aren't in
the programming language, threads are something in the
operating system – and they inherit all the problems that they
have in the operating system. One of the problems is granularity
of the memory management system. The memory management
in the operating system protects whole pages of memory, so the
smallest size that a thread can be is the smallest size of a page.
That's actually too big.
-- Joe Armstrong
goroutines
Initial stack size is 2kb (as of 1.4), but then is dynamically
allocated
goroutines are green threads that are multiplexed as needed
onto native threads, so there isn't a 1:1 mapping.
erlang processes
so...
Not an OS process, but still isolated.
No side effects. If a process crashes, other processes are not
affected.
Managed by the VM, rather than the OS.
Immutable data structures sidestep shared mutable state.
Processes communicate through message passing.
Fault-tolerant
go on...
Lightweight memory footprint.
Dynamically allocated stack.
All of this applies to Elixir as well.
{_, bits} = :erlang.process_info(
spawn(fn -> nil end),
:memory
)
bits / 8 # 340.0
who cares?
we are now able to easily push our systems to over 2 million tcp
connections!
-- WhatsApp (https://blog.whatsapp.com/196/1-million-is-so-
2011)
so how do processes talk?
Sources:
https://www.youtube.com/watch?v=hlmMi0pWzJE
http://blog.nindalf.com/how-goroutines-work/
http://www1.erlang.org/doc/efficiency_guide/processes.html
https://speakerdeck.com/7grok/processes-threads-and-the-
death-of-moores-law
http://learnyousomeerlang.com/
https://www.infoq.com/presentations/erlang-software-for-a-
concurrent-world

More Related Content

Viewers also liked

Rocket City Perk6e
Rocket City Perk6eRocket City Perk6e
Rocket City Perk6eM.T. Bryan
 
logo5
logo5logo5
logo5AZOTT
 
Atividade 2 ficha de apoio - história e física e química
Atividade 2  ficha de apoio - história e física e químicaAtividade 2  ficha de apoio - história e física e química
Atividade 2 ficha de apoio - história e física e químicaantoniopedropinheiro
 
Comercio internacional
Comercio internacionalComercio internacional
Comercio internacional
Manuel Bedoya D
 
Pink Floyd Digipak
Pink Floyd DigipakPink Floyd Digipak
Pink Floyd Digipak
Ruben Clark
 
Tract bibliodebout2
Tract bibliodebout2Tract bibliodebout2
Tract bibliodebout2
Calimaq S.I.Lex
 
Add Some Ninja To Your Website
Add Some Ninja To Your WebsiteAdd Some Ninja To Your Website
Add Some Ninja To Your Website
Cameron Jones
 
Toimeentulotuen kuumat perunat sidosryhmätilaisuus 09022017
Toimeentulotuen kuumat perunat  sidosryhmätilaisuus  09022017Toimeentulotuen kuumat perunat  sidosryhmätilaisuus  09022017
Toimeentulotuen kuumat perunat sidosryhmätilaisuus 09022017
Kela
 
Active Sourcing: WOW, ich habe einen Kandidaten! Und jetzt?
Active Sourcing: WOW, ich habe einen Kandidaten! Und jetzt?Active Sourcing: WOW, ich habe einen Kandidaten! Und jetzt?
Active Sourcing: WOW, ich habe einen Kandidaten! Und jetzt?
Barbara Braehmer
 

Viewers also liked (11)

photo book
photo bookphoto book
photo book
 
Rocket City Perk6e
Rocket City Perk6eRocket City Perk6e
Rocket City Perk6e
 
logo5
logo5logo5
logo5
 
Atividade 2 ficha de apoio - história e física e química
Atividade 2  ficha de apoio - história e física e químicaAtividade 2  ficha de apoio - história e física e química
Atividade 2 ficha de apoio - história e física e química
 
Comercio internacional
Comercio internacionalComercio internacional
Comercio internacional
 
Pink Floyd Digipak
Pink Floyd DigipakPink Floyd Digipak
Pink Floyd Digipak
 
Tract bibliodebout2
Tract bibliodebout2Tract bibliodebout2
Tract bibliodebout2
 
Add Some Ninja To Your Website
Add Some Ninja To Your WebsiteAdd Some Ninja To Your Website
Add Some Ninja To Your Website
 
Toimeentulotuen kuumat perunat sidosryhmätilaisuus 09022017
Toimeentulotuen kuumat perunat  sidosryhmätilaisuus  09022017Toimeentulotuen kuumat perunat  sidosryhmätilaisuus  09022017
Toimeentulotuen kuumat perunat sidosryhmätilaisuus 09022017
 
meganvietorUnisys2016
meganvietorUnisys2016meganvietorUnisys2016
meganvietorUnisys2016
 
Active Sourcing: WOW, ich habe einen Kandidaten! Und jetzt?
Active Sourcing: WOW, ich habe einen Kandidaten! Und jetzt?Active Sourcing: WOW, ich habe einen Kandidaten! Und jetzt?
Active Sourcing: WOW, ich habe einen Kandidaten! Und jetzt?
 

Similar to PromptWorks Talk Tuesdays: Ray Zane 9/13/16 "Elixir Processes"

ppt
pptppt
Project Earl Grey
Project Earl GreyProject Earl Grey
Project Earl Grey
Jaehoon Choi
 
Actors, Fault tolerance and OTP
Actors, Fault tolerance and OTPActors, Fault tolerance and OTP
Actors, Fault tolerance and OTP
Dhananjay Nene
 
Shared memory Parallelism (NOTES)
Shared memory Parallelism (NOTES)Shared memory Parallelism (NOTES)
Shared memory Parallelism (NOTES)
Subhajit Sahu
 
4.Process.ppt
4.Process.ppt4.Process.ppt
4.Process.ppt
AkfeteAssefa
 
Memory management
Memory managementMemory management
Memory management
MuhammadRobeel3
 
Architecture of web servers
Architecture of web serversArchitecture of web servers
Architecture of web servers
Nicolas Vanhoren
 
Threads
ThreadsThreads
Java Threading
Java ThreadingJava Threading
Java Threading
Guillermo Schwarz
 
Osdc 2011 michael_neale
Osdc 2011 michael_nealeOsdc 2011 michael_neale
Osdc 2011 michael_neale
Michael Neale
 
A quick view about Java Virtual Machine
A quick view about Java Virtual MachineA quick view about Java Virtual Machine
A quick view about Java Virtual Machine
João Santana
 
Unit 1 q&a
Unit  1 q&aUnit  1 q&a
Linux Internals - Interview essentials - 1.0
Linux Internals - Interview essentials - 1.0Linux Internals - Interview essentials - 1.0
Linux Internals - Interview essentials - 1.0
Emertxe Information Technologies Pvt Ltd
 
Mysql talk
Mysql talkMysql talk
Mysql talk
LogicMonitor
 
Concurrent Programming with Ruby and Tuple Spaces
Concurrent Programming with Ruby and Tuple SpacesConcurrent Programming with Ruby and Tuple Spaces
Concurrent Programming with Ruby and Tuple Spaces
luccastera
 
Multiprocessor system
Multiprocessor systemMultiprocessor system
Multiprocessor system
El-Moataz Bellah Osama
 
unit5_os (1).pptx
unit5_os (1).pptxunit5_os (1).pptx
unit5_os (1).pptx
PriyankaJadhav218236
 

Similar to PromptWorks Talk Tuesdays: Ray Zane 9/13/16 "Elixir Processes" (20)

ppt
pptppt
ppt
 
Project Earl Grey
Project Earl GreyProject Earl Grey
Project Earl Grey
 
Actors, Fault tolerance and OTP
Actors, Fault tolerance and OTPActors, Fault tolerance and OTP
Actors, Fault tolerance and OTP
 
Shared memory Parallelism (NOTES)
Shared memory Parallelism (NOTES)Shared memory Parallelism (NOTES)
Shared memory Parallelism (NOTES)
 
4.Process.ppt
4.Process.ppt4.Process.ppt
4.Process.ppt
 
Memory management
Memory managementMemory management
Memory management
 
Architecture of web servers
Architecture of web serversArchitecture of web servers
Architecture of web servers
 
Threads
ThreadsThreads
Threads
 
Java Threading
Java ThreadingJava Threading
Java Threading
 
Osdc 2011 michael_neale
Osdc 2011 michael_nealeOsdc 2011 michael_neale
Osdc 2011 michael_neale
 
A quick view about Java Virtual Machine
A quick view about Java Virtual MachineA quick view about Java Virtual Machine
A quick view about Java Virtual Machine
 
Ruby Concurrency
Ruby ConcurrencyRuby Concurrency
Ruby Concurrency
 
Unit 1 q&a
Unit  1 q&aUnit  1 q&a
Unit 1 q&a
 
Linux Memory
Linux MemoryLinux Memory
Linux Memory
 
Linux Internals - Interview essentials - 1.0
Linux Internals - Interview essentials - 1.0Linux Internals - Interview essentials - 1.0
Linux Internals - Interview essentials - 1.0
 
Mysql talk
Mysql talkMysql talk
Mysql talk
 
Concurrent Programming with Ruby and Tuple Spaces
Concurrent Programming with Ruby and Tuple SpacesConcurrent Programming with Ruby and Tuple Spaces
Concurrent Programming with Ruby and Tuple Spaces
 
Multiprocessor system
Multiprocessor systemMultiprocessor system
Multiprocessor system
 
Wiki 2
Wiki 2Wiki 2
Wiki 2
 
unit5_os (1).pptx
unit5_os (1).pptxunit5_os (1).pptx
unit5_os (1).pptx
 

Recently uploaded

Globus Compute Introduction - GlobusWorld 2024
Globus Compute Introduction - GlobusWorld 2024Globus Compute Introduction - GlobusWorld 2024
Globus Compute Introduction - GlobusWorld 2024
Globus
 
OpenFOAM solver for Helmholtz equation, helmholtzFoam / helmholtzBubbleFoam
OpenFOAM solver for Helmholtz equation, helmholtzFoam / helmholtzBubbleFoamOpenFOAM solver for Helmholtz equation, helmholtzFoam / helmholtzBubbleFoam
OpenFOAM solver for Helmholtz equation, helmholtzFoam / helmholtzBubbleFoam
takuyayamamoto1800
 
How Recreation Management Software Can Streamline Your Operations.pptx
How Recreation Management Software Can Streamline Your Operations.pptxHow Recreation Management Software Can Streamline Your Operations.pptx
How Recreation Management Software Can Streamline Your Operations.pptx
wottaspaceseo
 
Large Language Models and the End of Programming
Large Language Models and the End of ProgrammingLarge Language Models and the End of Programming
Large Language Models and the End of Programming
Matt Welsh
 
Prosigns: Transforming Business with Tailored Technology Solutions
Prosigns: Transforming Business with Tailored Technology SolutionsProsigns: Transforming Business with Tailored Technology Solutions
Prosigns: Transforming Business with Tailored Technology Solutions
Prosigns
 
Pro Unity Game Development with C-sharp Book
Pro Unity Game Development with C-sharp BookPro Unity Game Development with C-sharp Book
Pro Unity Game Development with C-sharp Book
abdulrafaychaudhry
 
Enhancing Research Orchestration Capabilities at ORNL.pdf
Enhancing Research Orchestration Capabilities at ORNL.pdfEnhancing Research Orchestration Capabilities at ORNL.pdf
Enhancing Research Orchestration Capabilities at ORNL.pdf
Globus
 
Text-Summarization-of-Breaking-News-Using-Fine-tuning-BART-Model.pptx
Text-Summarization-of-Breaking-News-Using-Fine-tuning-BART-Model.pptxText-Summarization-of-Breaking-News-Using-Fine-tuning-BART-Model.pptx
Text-Summarization-of-Breaking-News-Using-Fine-tuning-BART-Model.pptx
ShamsuddeenMuhammadA
 
Understanding Globus Data Transfers with NetSage
Understanding Globus Data Transfers with NetSageUnderstanding Globus Data Transfers with NetSage
Understanding Globus Data Transfers with NetSage
Globus
 
May Marketo Masterclass, London MUG May 22 2024.pdf
May Marketo Masterclass, London MUG May 22 2024.pdfMay Marketo Masterclass, London MUG May 22 2024.pdf
May Marketo Masterclass, London MUG May 22 2024.pdf
Adele Miller
 
Globus Connect Server Deep Dive - GlobusWorld 2024
Globus Connect Server Deep Dive - GlobusWorld 2024Globus Connect Server Deep Dive - GlobusWorld 2024
Globus Connect Server Deep Dive - GlobusWorld 2024
Globus
 
BoxLang: Review our Visionary Licenses of 2024
BoxLang: Review our Visionary Licenses of 2024BoxLang: Review our Visionary Licenses of 2024
BoxLang: Review our Visionary Licenses of 2024
Ortus Solutions, Corp
 
First Steps with Globus Compute Multi-User Endpoints
First Steps with Globus Compute Multi-User EndpointsFirst Steps with Globus Compute Multi-User Endpoints
First Steps with Globus Compute Multi-User Endpoints
Globus
 
A Study of Variable-Role-based Feature Enrichment in Neural Models of Code
A Study of Variable-Role-based Feature Enrichment in Neural Models of CodeA Study of Variable-Role-based Feature Enrichment in Neural Models of Code
A Study of Variable-Role-based Feature Enrichment in Neural Models of Code
Aftab Hussain
 
Top 7 Unique WhatsApp API Benefits | Saudi Arabia
Top 7 Unique WhatsApp API Benefits | Saudi ArabiaTop 7 Unique WhatsApp API Benefits | Saudi Arabia
Top 7 Unique WhatsApp API Benefits | Saudi Arabia
Yara Milbes
 
In 2015, I used to write extensions for Joomla, WordPress, phpBB3, etc and I ...
In 2015, I used to write extensions for Joomla, WordPress, phpBB3, etc and I ...In 2015, I used to write extensions for Joomla, WordPress, phpBB3, etc and I ...
In 2015, I used to write extensions for Joomla, WordPress, phpBB3, etc and I ...
Juraj Vysvader
 
Enterprise Resource Planning System in Telangana
Enterprise Resource Planning System in TelanganaEnterprise Resource Planning System in Telangana
Enterprise Resource Planning System in Telangana
NYGGS Automation Suite
 
AI Fusion Buddy Review: Brand New, Groundbreaking Gemini-Powered AI App
AI Fusion Buddy Review: Brand New, Groundbreaking Gemini-Powered AI AppAI Fusion Buddy Review: Brand New, Groundbreaking Gemini-Powered AI App
AI Fusion Buddy Review: Brand New, Groundbreaking Gemini-Powered AI App
Google
 
Providing Globus Services to Users of JASMIN for Environmental Data Analysis
Providing Globus Services to Users of JASMIN for Environmental Data AnalysisProviding Globus Services to Users of JASMIN for Environmental Data Analysis
Providing Globus Services to Users of JASMIN for Environmental Data Analysis
Globus
 
openEuler Case Study - The Journey to Supply Chain Security
openEuler Case Study - The Journey to Supply Chain SecurityopenEuler Case Study - The Journey to Supply Chain Security
openEuler Case Study - The Journey to Supply Chain Security
Shane Coughlan
 

Recently uploaded (20)

Globus Compute Introduction - GlobusWorld 2024
Globus Compute Introduction - GlobusWorld 2024Globus Compute Introduction - GlobusWorld 2024
Globus Compute Introduction - GlobusWorld 2024
 
OpenFOAM solver for Helmholtz equation, helmholtzFoam / helmholtzBubbleFoam
OpenFOAM solver for Helmholtz equation, helmholtzFoam / helmholtzBubbleFoamOpenFOAM solver for Helmholtz equation, helmholtzFoam / helmholtzBubbleFoam
OpenFOAM solver for Helmholtz equation, helmholtzFoam / helmholtzBubbleFoam
 
How Recreation Management Software Can Streamline Your Operations.pptx
How Recreation Management Software Can Streamline Your Operations.pptxHow Recreation Management Software Can Streamline Your Operations.pptx
How Recreation Management Software Can Streamline Your Operations.pptx
 
Large Language Models and the End of Programming
Large Language Models and the End of ProgrammingLarge Language Models and the End of Programming
Large Language Models and the End of Programming
 
Prosigns: Transforming Business with Tailored Technology Solutions
Prosigns: Transforming Business with Tailored Technology SolutionsProsigns: Transforming Business with Tailored Technology Solutions
Prosigns: Transforming Business with Tailored Technology Solutions
 
Pro Unity Game Development with C-sharp Book
Pro Unity Game Development with C-sharp BookPro Unity Game Development with C-sharp Book
Pro Unity Game Development with C-sharp Book
 
Enhancing Research Orchestration Capabilities at ORNL.pdf
Enhancing Research Orchestration Capabilities at ORNL.pdfEnhancing Research Orchestration Capabilities at ORNL.pdf
Enhancing Research Orchestration Capabilities at ORNL.pdf
 
Text-Summarization-of-Breaking-News-Using-Fine-tuning-BART-Model.pptx
Text-Summarization-of-Breaking-News-Using-Fine-tuning-BART-Model.pptxText-Summarization-of-Breaking-News-Using-Fine-tuning-BART-Model.pptx
Text-Summarization-of-Breaking-News-Using-Fine-tuning-BART-Model.pptx
 
Understanding Globus Data Transfers with NetSage
Understanding Globus Data Transfers with NetSageUnderstanding Globus Data Transfers with NetSage
Understanding Globus Data Transfers with NetSage
 
May Marketo Masterclass, London MUG May 22 2024.pdf
May Marketo Masterclass, London MUG May 22 2024.pdfMay Marketo Masterclass, London MUG May 22 2024.pdf
May Marketo Masterclass, London MUG May 22 2024.pdf
 
Globus Connect Server Deep Dive - GlobusWorld 2024
Globus Connect Server Deep Dive - GlobusWorld 2024Globus Connect Server Deep Dive - GlobusWorld 2024
Globus Connect Server Deep Dive - GlobusWorld 2024
 
BoxLang: Review our Visionary Licenses of 2024
BoxLang: Review our Visionary Licenses of 2024BoxLang: Review our Visionary Licenses of 2024
BoxLang: Review our Visionary Licenses of 2024
 
First Steps with Globus Compute Multi-User Endpoints
First Steps with Globus Compute Multi-User EndpointsFirst Steps with Globus Compute Multi-User Endpoints
First Steps with Globus Compute Multi-User Endpoints
 
A Study of Variable-Role-based Feature Enrichment in Neural Models of Code
A Study of Variable-Role-based Feature Enrichment in Neural Models of CodeA Study of Variable-Role-based Feature Enrichment in Neural Models of Code
A Study of Variable-Role-based Feature Enrichment in Neural Models of Code
 
Top 7 Unique WhatsApp API Benefits | Saudi Arabia
Top 7 Unique WhatsApp API Benefits | Saudi ArabiaTop 7 Unique WhatsApp API Benefits | Saudi Arabia
Top 7 Unique WhatsApp API Benefits | Saudi Arabia
 
In 2015, I used to write extensions for Joomla, WordPress, phpBB3, etc and I ...
In 2015, I used to write extensions for Joomla, WordPress, phpBB3, etc and I ...In 2015, I used to write extensions for Joomla, WordPress, phpBB3, etc and I ...
In 2015, I used to write extensions for Joomla, WordPress, phpBB3, etc and I ...
 
Enterprise Resource Planning System in Telangana
Enterprise Resource Planning System in TelanganaEnterprise Resource Planning System in Telangana
Enterprise Resource Planning System in Telangana
 
AI Fusion Buddy Review: Brand New, Groundbreaking Gemini-Powered AI App
AI Fusion Buddy Review: Brand New, Groundbreaking Gemini-Powered AI AppAI Fusion Buddy Review: Brand New, Groundbreaking Gemini-Powered AI App
AI Fusion Buddy Review: Brand New, Groundbreaking Gemini-Powered AI App
 
Providing Globus Services to Users of JASMIN for Environmental Data Analysis
Providing Globus Services to Users of JASMIN for Environmental Data AnalysisProviding Globus Services to Users of JASMIN for Environmental Data Analysis
Providing Globus Services to Users of JASMIN for Environmental Data Analysis
 
openEuler Case Study - The Journey to Supply Chain Security
openEuler Case Study - The Journey to Supply Chain SecurityopenEuler Case Study - The Journey to Supply Chain Security
openEuler Case Study - The Journey to Supply Chain Security
 

PromptWorks Talk Tuesdays: Ray Zane 9/13/16 "Elixir Processes"