Skip to content

Instantly share code, notes, and snippets.

@Freaky
Created July 23, 2015 20:45
Show Gist options
  • Save Freaky/1f42c4b8e0316cbabd39 to your computer and use it in GitHub Desktop.
Save Freaky/1f42c4b8e0316cbabd39 to your computer and use it in GitHub Desktop.
# Reliably hangs JRuby-9.0.0.0
# jruby 9.0.0.0 (2.2.2) 2015-07-21 e10ec96 OpenJDK 64-Bit Server VM 25.51-b03 on 1.8.0_51-b16 +jit [FreeBSD-amd64]
require 'securerandom'
Array.new(4).map do
Thread.new do
100_000.times do |i|
print "#{Thread.current.inspect}: #{i}\n" if i % 1000 == 0
key = SecureRandom.random_bytes(4)
hash = {}
hash[key] = true
end
end
end.map(&:join)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment