Sha256: 71b96cdf70d78359f479fed7c0451d550fb5cab8f08a6e48ae289f8ac7c49fd8
Contents?: true
Size: 348 Bytes
Versions: 104
Compression:
Stored size: 348 Bytes
Contents
module ThreadSafe describe Hash do let!(:hsh) { described_class.new } it 'concurrency' do (1..THREADS).map do |i| Thread.new do 1000.times do |j| hsh[i * 1000 + j] = i hsh[i * 1000 + j] hsh.delete(i * 1000 + j) end end end.map(&:join) end end end
Version data entries
104 entries across 98 versions & 30 rubygems