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
220
竝行
Rubyと竝行
concurrent/pararell
さっちゃん
September 14, 2017
Tweet
Share
More Decks by さっちゃん
See All by さっちゃん
みんなのオブザーバビリティプラットフォームを作ってるんだがパフォーマンスがやばい #mackerelio #srenext
ne_sachirou
0
1.4k
作ってよかったgraceful shutdownライブラリ #kyotogo
ne_sachirou
0
1.2k
path 依存型って何?
ne_sachirou
0
630
野生の onbording と onbording 設計 #kyototechtalk
ne_sachirou
0
630
メトリックはいかにして見え續ける樣になったか #devio2022
ne_sachirou
0
89
名實一致
ne_sachirou
0
660
まかれるあなとみあ ―Mackerel のしくみを理解する 30 分― @ Hatena Engineer Seminar #16
ne_sachirou
0
3.1k
tacit programming : Point-free, Concatenatives & J
ne_sachirou
0
980
Monitoring Containerized Elixir
ne_sachirou
1
970
Other Decks in Programming
See All in Programming
TypeScript LSP の今までとこれから
quramy
1
500
ワイがおすすめする新潟の食 / 20250530phpconf-niigata-eve
kasacchiful
0
300
データベースコネクションプール(DBCP)の変遷と理解
fujikawa8
1
250
つよそうにふるまい、つよい成果を出すのなら、つよいのかもしれない
irof
1
280
技術懸念に立ち向かい 法改正を穏便に乗り切った話
pop_cashew
0
1.3k
Go1.25からのGOMAXPROCS
kuro_kurorrr
0
210
コード書くの好きな人向けAIコーディング活用tips #orestudy
77web
3
300
Go Modules: From Basics to Beyond / Go Modulesの基本とその先へ
kuro_kurorrr
0
110
SODA - FACT BOOK
sodainc
1
840
Rails産でないDBを Railsに引っ越すHACK - Omotesando.rb #110
lnit
1
160
DroidKnights 2025 - 다양한 스크롤 뷰에서의 영상 재생
gaeun5744
2
130
実はすごいスピードで進化しているCSS
hayato_yokoyama
0
110
Featured
See All Featured
Stop Working from a Prison Cell
hatefulcrawdad
269
20k
Learning to Love Humans: Emotional Interface Design
aarron
273
40k
Evolution of real-time – Irina Nazarova, EuRuKo, 2024
irinanazarova
8
780
Producing Creativity
orderedlist
PRO
346
40k
GraphQLの誤解/rethinking-graphql
sonatard
71
11k
What’s in a name? Adding method to the madness
productmarketing
PRO
22
3.5k
ReactJS: Keep Simple. Everything can be a component!
pedronauck
667
120k
Practical Tips for Bootstrapping Information Extraction Pipelines
honnibal
PRO
20
1.3k
Reflections from 52 weeks, 52 projects
jeffersonlam
350
20k
BBQ
matthewcrist
89
9.7k
Build The Right Thing And Hit Your Dates
maggiecrowley
36
2.7k
Faster Mobile Websites
deanohume
307
31k
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