mirror of
https://github.com/ruby/ruby.git
synced 2025-08-15 13:39:04 +02:00
21 lines
398 B
YAML
21 lines
398 B
YAML
prelude: |
|
|
ios = 100.times.map do
|
|
10.times.map do
|
|
pipe = IO.pipe.tap do |r, w|
|
|
Thread.new do
|
|
r.read
|
|
rescue IOError
|
|
# Ignore
|
|
end
|
|
end
|
|
end
|
|
end
|
|
benchmark:
|
|
# Close IO
|
|
io_close_contended: |
|
|
# Process each batch of ios per iteration of the benchmark.
|
|
ios.pop.each do |r, w|
|
|
r.close
|
|
w.close
|
|
end
|
|
loop_count: 10
|