Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Solid Ground
Search
Saša Jurić
May 20, 2017
Programming
1.3k
15
Share
Solid Ground
Empex, 2017
Saša Jurić
May 20, 2017
More Decks by Saša Jurić
See All by Saša Jurić
Such Great Heights, Code BEAM Lite, Amsterdam 2018
sasajuric
0
200
Simplifying systems with Elixir - Belgrade
sasajuric
3
480
Simplifying systems with Elixir
sasajuric
2
600
Metagrokking Elixir
sasajuric
4
320
Solid Ground
sasajuric
3
930
Elixir - valentine edition
sasajuric
0
150
What's the fuss about Phoenix?
sasajuric
2
1.1k
Phoenix
sasajuric
1
260
Phoenix
sasajuric
0
150
Other Decks in Programming
See All in Programming
OCRを使ってゲームのアイテムをデータ化する
kishikawakatsumi
0
120
ReactとSvelteのその先、Ripple-TS / Beyond React and Svelte: Ripple-TS
ssssota
3
1.7k
Lemonade + Foundry Toolkit でお手軽アプリ開発
seosoft
1
220
AIエージェントの隔離技術の徹底比較
kawayu
0
440
AI Agent と正しく分析するための環境作り
yoshyum
3
640
バックエンドにElysiaJSを採用して気付いた、良い点・悪い点
wanko_it
1
190
生成AI時代にこそ効くGo | Why Go Works in the Age of Generative AI
mom0tomo
8
3k
AIとRubyの静的型付け
ukin0k0
0
430
[KCD Czech] eBPF Meets the GPU: Future of AI Infra Observability
doniacld
0
120
net-httpのHTTP/2対応について
naruse
0
330
These Five Tricks Can Make Your Apps Greener, Cheaper, & Nicer
hollycummins
0
240
技術記事、AIに書かせるか、自分で書くか? 〜それでも私が自分の手で書く理由〜 / #QiitaConference
jnchito
2
1.2k
Featured
See All Featured
The Invisible Side of Design
smashingmag
302
52k
HU Berlin: Industrial-Strength Natural Language Processing with spaCy and Prodigy
inesmontani
PRO
0
390
The World Runs on Bad Software
bkeepers
PRO
72
12k
Ruling the World: When Life Gets Gamed
codingconduct
0
240
CSS Pre-Processors: Stylus, Less & Sass
bermonpainter
360
30k
The Language of Interfaces
destraynor
162
26k
Sam Torres - BigQuery for SEOs
techseoconnect
PRO
0
280
XXLCSS - How to scale CSS and keep your sanity
sugarenia
250
1.3M
Applied NLP in the Age of Generative AI
inesmontani
PRO
4
2.3k
Effective software design: The role of men in debugging patriarchy in IT @ Voxxed Days AMS
baasie
0
370
Tell your own story through comics
letsgokoyo
1
930
Become a Pro
speakerdeck
PRO
31
6k
Transcript
Solid ground @sasajuric aircloak.com
pattern matching OTP metaprogramming mix Distillery the pipe operator Cowboy
Plug Phoenix Ecto functional programming community GenStage Credo ExUnit Combine Poolboy Nerves
None
LFE Erlang OTP BEAM Elixir Phoenix GenStage Ecto Plug magic
source magic beneficiaries Cowboy Poolboy
long-running system many tasks soft real-time finite time program all-or-nothing
hard real-time
scheduler scheduler scheduler scheduler BEAM CPU CPU CPU CPU
frequent context switches
t1 t2 t3 t4 t5 10 s 1 ms 1
ms 1 ms 1 ms
t1 BEAM scheduler t2 t3 t4 t5 t1
t1 cooperative scheduler t2 t3 t4 t5
thread 1 thread n long running task long running task
blocked cooperative scheduler …
thread 1 thread n long running task long running task
BEAM scheduler … not blocked :-)
activities as runtime citizens
send(pid, :please_stop)
mref = Process.monitor(pid) send(pid, :please_stop) receive do {:DOWN, ^mref, :process,
^pid, _reason} -> :ok end
mref = Process.monitor(pid) send(pid, :please_stop) receive do {:DOWN, ^mref, :process,
^pid, _reason} -> :ok after :timer.seconds(5) -> Process.exit(pid, :kill) receive do {:DOWN, ^mref, :process, ^pid, _reason} -> :ok end end
task = Task.async(fn -> ... end) case Task.yield(task, :timer.seconds(5)) do
{:ok, result} -> do_something(result) nil -> Task.shutdown(task, :brutal_kill) end
shared-nothing concurrency
Process heap resources
process-owned “stuff” is released
supervision tree
system backend frontend chat history repo cache endpoint
system backend chat history repo
supervisor foundations frequent context switching activities as runtime citizens observable
process termination stoppable processes shared-nothing concurrency
syntax developer friendliness ecosystem
runtime guarantees syntax developer friendliness ecosystem
Scales of Justice image taken from clipartfox.com How Erlang does
scheduling http://jlouisramblings.blogspot.hr/2013/01/how-erlang-does-scheduling.html Erlang scheduler details https://hamidreza-s.github.io/erlang/scheduling/real-time/preemptive/migration/ 2016/02/09/erlang-scheduler-details.html The BEAM book https://github.com/happi/theBeamBook BEAM wisdoms http://beam-wisdoms.clau.se/en/latest/ Web based observer https://github.com/shinyscorpion/wobserver Recon http://ferd.github.io/recon/ Erlang performance lab http://www.erlang.pl/