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
230
竝行
Rubyと竝行
concurrent/pararell
さっちゃん
September 14, 2017
Tweet
Share
More Decks by さっちゃん
See All by さっちゃん
みんなのオブザーバビリティプラットフォームを作ってるんだがパフォーマンスがやばい #mackerelio #srenext
ne_sachirou
0
1.6k
作ってよかったgraceful shutdownライブラリ #kyotogo
ne_sachirou
0
1.4k
path 依存型って何?
ne_sachirou
0
750
野生の onbording と onbording 設計 #kyototechtalk
ne_sachirou
0
680
メトリックはいかにして見え續ける樣になったか #devio2022
ne_sachirou
0
110
名實一致
ne_sachirou
0
710
まかれるあなとみあ ―Mackerel のしくみを理解する 30 分― @ Hatena Engineer Seminar #16
ne_sachirou
0
3.2k
tacit programming : Point-free, Concatenatives & J
ne_sachirou
0
1.1k
Monitoring Containerized Elixir
ne_sachirou
1
1k
Other Decks in Programming
See All in Programming
AI & Enginnering
codelynx
0
110
CSC307 Lecture 08
javiergs
PRO
0
670
Automatic Grammar Agreementと Markdown Extended Attributes について
kishikawakatsumi
0
190
今から始めるClaude Code超入門
448jp
8
8.8k
なぜSQLはAIぽく見えるのか/why does SQL look AI like
florets1
0
460
そのAIレビュー、レビューしてますか? / Are you reviewing those AI reviews?
rkaga
6
4.6k
生成AIを使ったコードレビューで定性的に品質カバー
chiilog
1
270
Patterns of Patterns
denyspoltorak
0
1.4k
AI Schema Enrichment for your Oracle AI Database
thatjeffsmith
0
280
izumin5210のプロポーザルのネタ探し #tskaigi_msup
izumin5210
1
130
コマンドとリード間の連携に対する脅威分析フレームワーク
pandayumi
1
450
CSC307 Lecture 06
javiergs
PRO
0
690
Featured
See All Featured
Intergalactic Javascript Robots from Outer Space
tanoku
273
27k
Refactoring Trust on Your Teams (GOTO; Chicago 2020)
rmw
35
3.4k
The Art of Delivering Value - GDevCon NA Keynote
reverentgeek
16
1.8k
The agentic SEO stack - context over prompts
schlessera
0
640
Optimizing for Happiness
mojombo
379
71k
The Hidden Cost of Media on the Web [PixelPalooza 2025]
tammyeverts
2
190
How To Stay Up To Date on Web Technology
chriscoyier
791
250k
Unsuck your backbone
ammeep
671
58k
Chasing Engaging Ingredients in Design
codingconduct
0
110
Breaking role norms: Why Content Design is so much more than writing copy - Taylor Woolridge
uxyall
0
170
Agile Leadership in an Agile Organization
kimpetersen
PRO
0
82
Being A Developer After 40
akosma
91
590k
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