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
Sponsored
·
SiteGround - Reliable hosting with speed, security, and support you can count on.
→
さっちゃん
September 14, 2017
Programming
240
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
竝行
Rubyと竝行
concurrent/pararell
さっちゃん
September 14, 2017
More Decks by さっちゃん
See All by さっちゃん
火星曆
ne_sachirou
0
24
みんなのオブザーバビリティプラットフォームを作ってるんだがパフォーマンスがやばい #mackerelio #srenext
ne_sachirou
0
1.7k
作ってよかったgraceful shutdownライブラリ #kyotogo
ne_sachirou
0
1.4k
path 依存型って何?
ne_sachirou
0
830
野生の onbording と onbording 設計 #kyototechtalk
ne_sachirou
0
730
メトリックはいかにして見え續ける樣になったか #devio2022
ne_sachirou
0
130
名實一致
ne_sachirou
0
740
まかれるあなとみあ ―Mackerel のしくみを理解する 30 分― @ Hatena Engineer Seminar #16
ne_sachirou
0
3.3k
tacit programming : Point-free, Concatenatives & J
ne_sachirou
0
1.1k
Other Decks in Programming
See All in Programming
並列実装の現場、2ヶ月間実務でAIを使い倒したAIもPCも私も限界が近い
ming_ayami
0
110
コンテキストの使い捨てをやめる — ビジネスルール駆動開発と miko —
ioki
0
170
Claspは野良GASの夢をみるか
takter00
0
170
Old Dog, New Tricks: The Java 25 Reinvention - JNation
bazlur_rahman
0
150
軽量Java基盤の設計 DIコンテナに頼らない、長期保守と1秒起動の実現 JJUG CCC 2026 Spring
macha64
0
470
A2UI という光を覗いてみる
satohjohn
1
110
LLM Plugin for Node-REDの利用方法と開発について
404background
0
160
oxlintはeslint/typescript-eslintを置き換えられるのか
shomafujita
2
330
Technical Debt: Understanding it Rightly, Engaging it Rightly #LaravelLiveJP
shogogg
0
200
AIとRubyの静的型付け
ukin0k0
0
550
TAKTでAI駆動開発の品質を設計する
j5ik2o
6
1k
Webフレームワークの ベンチマークについて
yusukebe
0
150
Featured
See All Featured
Raft: Consensus for Rubyists
vanstee
141
7.5k
個人開発の失敗を避けるイケてる考え方 / tips for indie hackers
panda_program
122
22k
Context Engineering - Making Every Token Count
addyosmani
9
950
How GitHub (no longer) Works
holman
316
150k
The Curious Case for Waylosing
cassininazir
1
380
Ten Tips & Tricks for a 🌱 transition
stuffmc
0
130
Between Models and Reality
mayunak
4
330
Building Experiences: Design Systems, User Experience, and Full Site Editing
marktimemedia
0
520
Breaking role norms: Why Content Design is so much more than writing copy - Taylor Woolridge
uxyall
0
310
Designing for humans not robots
tammielis
254
26k
Producing Creativity
orderedlist
PRO
348
40k
Groundhog Day: Seeking Process in Gaming for Health
codingconduct
0
200
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