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
210
竝行
Rubyと竝行
concurrent/pararell
さっちゃん
September 14, 2017
Tweet
Share
More Decks by さっちゃん
See All by さっちゃん
みんなのオブザーバビリティプラットフォームを作ってるんだがパフォーマンスがやばい #mackerelio #srenext
ne_sachirou
0
1.3k
作ってよかったgraceful shutdownライブラリ #kyotogo
ne_sachirou
0
1.2k
path 依存型って何?
ne_sachirou
0
540
野生の onbording と onbording 設計 #kyototechtalk
ne_sachirou
0
610
メトリックはいかにして見え續ける樣になったか #devio2022
ne_sachirou
0
76
名實一致
ne_sachirou
0
630
まかれるあなとみあ ―Mackerel のしくみを理解する 30 分― @ Hatena Engineer Seminar #16
ne_sachirou
0
3k
tacit programming : Point-free, Concatenatives & J
ne_sachirou
0
910
Monitoring Containerized Elixir
ne_sachirou
1
940
Other Decks in Programming
See All in Programming
CI改善もDatadogとともに
taumu
0
200
dbt Pythonモデルで実現するSnowflake活用術
trsnium
0
260
Django NinjaによるAPI開発の効率化とリプレースの実践
kashewnuts
1
260
複数のAWSアカウントから横断で 利用する Lambda Authorizer の作り方
tc3jp
0
120
Honoのおもしろいミドルウェアをみてみよう
yusukebe
1
230
PHPカンファレンス名古屋2025 タスク分解の試行錯誤〜レビュー負荷を下げるために〜
soichi
1
680
2025.2.14_Developers Summit 2025_登壇資料
0101unite
0
200
kintone開発を効率化するためにチームで試した施策とその結果を大放出!
oguemon
0
160
Jakarta EE meets AI
ivargrimstad
0
370
もう僕は OpenAPI を書きたくない
sgash708
6
1.9k
機能が複雑化しても 頼りになる FactoryBotの話
tamikof
0
160
Learning Kotlin with detekt
inouehi
1
140
Featured
See All Featured
Statistics for Hackers
jakevdp
797
220k
Code Review Best Practice
trishagee
67
18k
個人開発の失敗を避けるイケてる考え方 / tips for indie hackers
panda_program
100
18k
RailsConf 2023
tenderlove
29
1k
Bash Introduction
62gerente
611
210k
Fireside Chat
paigeccino
34
3.2k
Gamification - CAS2011
davidbonilla
80
5.2k
Automating Front-end Workflow
addyosmani
1368
200k
Build The Right Thing And Hit Your Dates
maggiecrowley
34
2.5k
Git: the NoSQL Database
bkeepers
PRO
427
65k
Visualizing Your Data: Incorporating Mongo into Loggly Infrastructure
mongodb
45
9.4k
KATA
mclloyd
29
14k
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