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ć
March 06, 2017
Programming
3
820
Solid Ground
ElixirDaze 2017
Video available at
https://www.youtube.com/watch?v=5SbWapbXhKo
Saša Jurić
March 06, 2017
Tweet
Share
More Decks by Saša Jurić
See All by Saša Jurić
Such Great Heights, Code BEAM Lite, Amsterdam 2018
sasajuric
0
150
Simplifying systems with Elixir - Belgrade
sasajuric
3
410
Simplifying systems with Elixir
sasajuric
2
550
Metagrokking Elixir
sasajuric
4
280
Solid Ground
sasajuric
15
1.2k
Elixir - valentine edition
sasajuric
0
120
What's the fuss about Phoenix?
sasajuric
2
1k
Phoenix
sasajuric
1
200
Phoenix
sasajuric
0
110
Other Decks in Programming
See All in Programming
事業フェーズの変化に対応する 開発生産性向上のゼロイチ
masaygggg
0
200
状態管理ライブラリZustandの導入から運用まで
k1tikurisu
3
470
エンジニア1年目で複雑なコードの改善に取り組んだ話
mtnmr
3
2k
What is Parser
yui_knk
9
4.1k
Lessons by WebAssembly app in production on CDN Edge Computing Service
tetsuharuohzeki
0
210
Jakarta EE meets AI
ivargrimstad
1
520
ドメイン駆動設計を実践するために必要なもの
bikisuke
4
330
今インフラ技術をイチから学び直すなら
yuhta28
1
140
Kotlin 2.0 and Beyond
antonarhipov
2
150
実践!難読化ガイド
mitchan
0
200
Method Swizzlingを行うライブラリにおけるマルチモジュール設計
yoshikma
0
120
Scala におけるコンパイラエラーとの付き合い方
chencmd
2
430
Featured
See All Featured
How To Stay Up To Date on Web Technology
chriscoyier
786
250k
The World Runs on Bad Software
bkeepers
PRO
64
11k
Clear Off the Table
cherdarchuk
91
320k
Scaling GitHub
holman
458
140k
Into the Great Unknown - MozCon
thekraken
29
1.4k
Art, The Web, and Tiny UX
lynnandtonic
294
20k
Infographics Made Easy
chrislema
239
18k
Product Roadmaps are Hard
iamctodd
PRO
48
10k
Speed Design
sergeychernyshev
22
430
XXLCSS - How to scale CSS and keep your sanity
sugarenia
246
1.3M
It's Worth the Effort
3n
182
27k
実際に使うSQLの書き方 徹底解説 / pgcon21j-tutorial
soudai
166
48k
Transcript
Solid ground @sasajuric aircloak.com
None
long-running system many tasks soft real-time finite time program all-or-nothing
hard real-time
NIFs
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 t2 t3 t4 t5 t1 BEAM scheduler
t2 t3 t4 t5 t1 cooperative scheduler
thread 1 thread n … long running task long running
task blocked cooperative scheduler
thread 1 thread n … long running task long running
task not blocked :-) BEAM scheduler
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
runtime guarantees syntax developer friendliness ecosystem
Image credit Scales of Justice