Last active
December 17, 2015 18:59
-
-
Save edbond/5657089 to your computer and use it in GitHub Desktop.
ruby-thread issue? https://github.com/meh/ruby-thread/issues/5
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'thread/pool' | |
class ChartExport | |
def self._threads_test | |
a = Queue.new | |
1000.times { | |
pool = Thread.pool(10) | |
100.times { | |
pool.process { a << 1 } | |
} | |
pool.shutdown | |
} | |
puts "Should be 100000" | |
puts a.size | |
raise "Invalid result" unless a.size == 100000 | |
end | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'thread/pool' | |
a = Queue.new | |
1000.times { | |
pool = Thread.pool(10) | |
100.times { | |
pool.process { a << 1 } | |
} | |
pool.shutdown | |
} | |
puts "Should be 100000" | |
puts a.size | |
raise "Invalid result" unless a.size == 100000 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Run as: