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.5k
作ってよかったgraceful shutdownライブラリ #kyotogo
ne_sachirou
0
1.3k
path 依存型って何?
ne_sachirou
0
650
野生の onbording と onbording 設計 #kyototechtalk
ne_sachirou
0
630
メトリックはいかにして見え續ける樣になったか #devio2022
ne_sachirou
0
91
名實一致
ne_sachirou
0
670
まかれるあなとみあ ―Mackerel のしくみを理解する 30 分― @ Hatena Engineer Seminar #16
ne_sachirou
0
3.1k
tacit programming : Point-free, Concatenatives & J
ne_sachirou
0
990
Monitoring Containerized Elixir
ne_sachirou
1
980
Other Decks in Programming
See All in Programming
イベントストーミング図からコードへの変換手順 / Procedure for Converting Event Storming Diagrams to Code
nrslib
2
980
20250704_教育事業におけるアジャイルなデータ基盤構築
hanon52_
5
910
ソフトウェア品質を数字で捉える技術。事業成長を支えるシステム品質の マネジメント
takuya542
2
14k
Result型で“失敗”を型にするPHPコードの書き方
kajitack
5
980
Android 16KBページサイズ対応をはじめからていねいに
mine2424
0
240
Advanced Micro Frontends: Multi Version/ Framework Scenarios @WAD 2025, Berlin
manfredsteyer
PRO
0
370
CDK引数設計道場100本ノック
badmintoncryer
2
370
#kanrk08 / 公開版 PicoRubyとマイコンでの自作トレーニング計測装置を用いたワークアウトの理想と現実
bash0c7
1
900
AI コーディングエージェントの時代へ:JetBrains が描く開発の未来
masaruhr
1
200
Modern Angular with Signals and Signal Store:New Rules for Your Architecture @enterJS Advanced Angular Day 2025
manfredsteyer
PRO
0
250
フロントエンドのパフォーマンスチューニング
koukimiura
5
1.9k
The Modern View Layer Rails Deserves: A Vision For 2025 And Beyond @ RailsConf 2025, Philadelphia, PA
marcoroth
2
680
Featured
See All Featured
Faster Mobile Websites
deanohume
307
31k
Performance Is Good for Brains [We Love Speed 2024]
tammyeverts
10
970
Learning to Love Humans: Emotional Interface Design
aarron
273
40k
Writing Fast Ruby
sferik
628
62k
Thoughts on Productivity
jonyablonski
69
4.7k
What’s in a name? Adding method to the madness
productmarketing
PRO
23
3.5k
KATA
mclloyd
30
14k
CSS Pre-Processors: Stylus, Less & Sass
bermonpainter
357
30k
Stop Working from a Prison Cell
hatefulcrawdad
271
21k
Building Better People: How to give real-time feedback that sticks.
wjessup
367
19k
Easily Structure & Communicate Ideas using Wireframe
afnizarnur
194
16k
A better future with KSS
kneath
238
17k
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