Slide 39
Slide 39 text
ϝΠϯϓϩάϥϜͷ࣮
producers = 3.times.map { |i|
Ractor.new(channel, numbering, name: "P-#{i + 1}") do |ch, num|
Producer.new(ch, num).run
end
}
consumers = 3.times.map { |i|
Ractor.new(channel, name: "C-#{i + 1}") do |ch|
Consumer.new(ch).run
end
}
producers.each(&:take)
consumers.each(&:take)
ͭͷ3BDUPSͰ
1SPEVDFSΦϒδΣΫτΛ
ੜ͠ɺՔಇͤ͞Δ
ͭͷ3BDUPSͰ
$POTVNFSΦϒδΣΫτΛ
ੜ͠ɺՔಇͤ͞Δ