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
竝行
Search
さっちゃん
September 14, 2017
Programming
0
200
竝行
Rubyと竝行
concurrent/pararell
さっちゃん
September 14, 2017
Tweet
Share
More Decks by さっちゃん
See All by さっちゃん
作ってよかったgraceful shutdownライブラリ #kyotogo
ne_sachirou
0
830
path 依存型って何?
ne_sachirou
0
290
野生の onbording と onbording 設計 #kyototechtalk
ne_sachirou
0
470
メトリックはいかにして見え續ける樣になったか #devio2022
ne_sachirou
0
54
名實一致
ne_sachirou
0
560
まかれるあなとみあ ―Mackerel のしくみを理解する 30 分― @ Hatena Engineer Seminar #16
ne_sachirou
0
2.9k
tacit programming : Point-free, Concatenatives & J
ne_sachirou
0
650
Monitoring Containerized Elixir
ne_sachirou
1
810
Let's create stateful systems, by Elixir
ne_sachirou
1
750
Other Decks in Programming
See All in Programming
Site Reliability Engineering for GMO
pyama86
8
1k
Fragment Composition of GraphQL
quramy
6
910
『Railsオワコン』と言われる時代に、なぜブルーモ証券はRailsを選ぶのか
free_world21
0
150
try!Swift Tokyo 2024 参加報告 LT
akidon0000
1
220
FigmaとPHPで作る1ミリたりとも表示崩れしない最強の帳票印刷ソリューション
ttskch
43
19k
見た目から始める生産性向上
ikumatadokoro
7
830
単体テストを書かない技術 #phpcon_odawara
o0h
PRO
27
8.2k
ゆるい個人開発のススメ
kuroppe1819
10
990
Zero Waste, Radical Magic, and Italian Graft – Quarkus Efficiency Secrets
hollycummins
0
230
GraphQLサーバの構成要素を整理する #ハッカー鮨 #tsukijigraphql / graphql server technology selection
izumin5210
4
830
What We Can Learn From OSS
inouehi
0
420
R言語の環境構築と基礎 Tokyo.R 112
bob3bob3
0
270
Featured
See All Featured
Optimizing for Happiness
mojombo
370
69k
Happy Clients
brianwarren
92
6.4k
How To Stay Up To Date on Web Technology
chriscoyier
782
250k
The Power of CSS Pseudo Elements
geoffreycrofte
60
5k
Practical Orchestrator
shlominoach
182
9.7k
Reflections from 52 weeks, 52 projects
jeffersonlam
345
19k
Visualization
eitanlees
136
14k
Building Flexible Design Systems
yeseniaperezcruz
319
37k
Design and Strategy: How to Deal with People Who Don’t "Get" Design
morganepeng
116
18k
GraphQLとの向き合い方2022年版
quramy
32
12k
The Success of Rails: Ensuring Growth for the Next 100 Years
eileencodes
30
6k
Why You Should Never Use an ORM
jnunemaker
PRO
51
8.6k
Transcript
竝⾏ Pararell
.。oO(さっちゃんですよヾ(〃l _ l)ノ゙☆)
https://hex.pm/packages/holiday_jp https://hex.pm/packages/pqueue2 https://hex.pm/packages/stream_gzip https://hex.pm/packages/stream_hash
竝⾏ Pararell
Node.js is concurrent. Crystal is concurrent. Concurrent
Node.js is concurrent. Crystal is concurrent. Also Ruby is concurrent.
Concurrent
Thread thread1 = Thread.new { } thread2 = Thread.new {
} [thread1, thread2].each &:join Concurrent
Concurrent Ruby https://github.com/ruby-concurrency/concurrent-ruby future = Concurrent::Future.execute { } while future.pending?
sleep 0.1 end future.value Concurrent
Concurrent Ruby https://github.com/ruby-concurrency/concurrent-ruby Concurrent::Promise.execute { }.then { } Concurrent
Concurrent Ruby https://github.com/ruby-concurrency/concurrent-ruby class Echo include Concurrent::Async def echo(msg) print
"#{msg}\n” end End horn = Echo.new horn.async.echo 'oneʼ horn.await.echo 'two' Concurrent
EventMachine https://github.com/eventmachine/eventmachine/ EM::run do client = MyApp.new give_tick = proc
do Gtk::main_iteration_do false EM.next_tick give_tick end give_tick.call end Concurrent
nio4r https://github.com/socketry/nio4r selector = NIO::Selector.new loop do selector.select do |monitor|
end end Concurrent
Crystal https://crystal-lang.org/ ch = Channel(Int).new spawn do ch.send 42 end
value = ch.receive Concurrent
Concurrent ? Pararell ?
Concurrent 竝列 Concurrent Task Task Task
Pararell 竝⾏ Pararell Task Task Task
Go is pararell. Pararell
Go https://golang.org/ ch := make(chan string) go f(“some”, ch) <-
ch Pararell
Go is pararell. Pararell
Go is pararell. Ruby is _ Pararell
pararell https://github.com/grosser/parallel Pararell.map([]) { } Pararell.each([]) { } Pararell.any?([]) {
} Pararell.all?([]) { } Pararell
pararell Inside pararell: Pararell
pararell Inside pararell: Process.fork { } Pararell
pararell Inside pararell: Process.fork { } Pararell
Use Elixir Pararell
Use Elixir Pararell Pararell
Use Elixir Pararell Fault tolerant Pararell
Use Elixir Pararell Fault tolerant Soft realtime Pararell