Sha256: 5007b494869b642a0124957883dddff0899f7e1dcc628b5774cd7ff2ae601875
Contents?: true
Size: 375 Bytes
Versions: 35
Compression:
Stored size: 375 Bytes
Contents
require 'thread_safe' require File.join(File.dirname(__FILE__), "test_helper") class TestHash < Minitest::Test def test_concurrency hsh = ThreadSafe::Hash.new (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
Version data entries
35 entries across 33 versions & 17 rubygems