Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
Solid Ground
Search
Sponsored
·
Your Podcast. Everywhere. Effortlessly.
Share. Educate. Inspire. Entertain. You do you. We'll handle the rest.
→
Saša Jurić
May 20, 2017
Programming
1.3k
15
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Solid Ground
Empex, 2017
Saša Jurić
May 20, 2017
Transcript
27 slides
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/
More Decks by Saša Jurić
See All by Saša Jurić
Such Great Heights, Code BEAM Lite, Amsterdam 2018
sasajuric
0
220
Simplifying systems with Elixir - Belgrade
sasajuric
3
500
Simplifying systems with Elixir
sasajuric
2
630
Metagrokking Elixir
sasajuric
4
350
Solid Ground
sasajuric
3
960
Elixir - valentine edition
sasajuric
0
160
What's the fuss about Phoenix?
sasajuric
2
1.2k
Phoenix
sasajuric
1
310
Phoenix
sasajuric
0
180
Other Decks in Programming
See All in Programming
Ruby から Emacs を操作したい
phigasui
0
360
AI-Powered Domain-Driven Design
ziobrando
0
470
Goコンパイラを作ってGoをもっと理解する / Build a Go compiler to better understand Go
ikura_hamu
0
130
AI駆動開発4年目の現在地(『あなたはFDEになるべきか?』イベント資料)
kumaiu
0
660
仕様駆動開発入門 (何を作るかを先に決めて渡す) | 目指せ Kiro マスター 05
inariku
PRO
2
190
선언형 햅틱 라이브러리 진동을 소개합니다
l2hyunwoo
1
320
なぜ私たちは「現時点では」KMPの導入を見送ったのか
chigichan24
1
310
Augmenting AI with the Power of Jakarta EE
ivargrimstad
0
380
React Native経験者が Flutterを30⽇間触って驚いたこと
3saito
0
200
動画プレイヤーはなぜカクつくのか 〜Flutterのレンダリングとネイティブの境界を解剖する〜
naruogram
0
340
AI時代のシニアエンジニアとは
yosuke_furukawa
PRO
15
12k
止まらない比較を止める — 余帰納法で無限ストリームを比べる
tarao
0
190
Featured
See All Featured
Breaking role norms: Why Content Design is so much more than writing copy - Taylor Woolridge
uxyall
2
530
Navigating Weather and Climate Data
rabernat
0
590
No one is an island. Learnings from fostering a developers community.
thoeni
21
3.9k
What the history of the web can teach us about the future of AI
inesmontani
PRO
3
820
Hiding What from Whom? A Critical Review of the History of Programming languages for Music
tomoyanonymous
3
1.5k
Noah Learner - AI + Me: how we built a GSC Bulk Export data pipeline
techseoconnect
PRO
0
490
Stewardship and Sustainability of Urban and Community Forests
pwiseman
0
600
Effective software design: The role of men in debugging patriarchy in IT @ Voxxed Days AMS
baasie
1
620
Measuring Dark Social's Impact On Conversion and Attribution
stephenakadiri
2
330
Redefining SEO in the New Era of Traffic Generation
szymonslowik
1
530
Winning Ecommerce Organic Search in an AI Era - #searchnstuff2025
aleyda
2
2.2k
Improving Core Web Vitals using Speculation Rules API
sergeychernyshev
21
1.7k