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

Version Path
logstash-input-fifo-0.9.1 vendor/bundle/jruby/1.9/gems/thread_safe-0.3.5-java/test/test_hash.rb
logstash-input-fifo-0.9.0 vendor/bundle/jruby/1.9/gems/thread_safe-0.3.5-java/test/test_hash.rb
logstash-input-salesforce-3.0.0 vendor/jruby/1.9/gems/thread_safe-0.3.5-java/test/test_hash.rb
abaci-0.3.0 vendor/bundle/gems/thread_safe-0.3.5/test/test_hash.rb
ivanvc-logstash-input-s3-3.1.1.4 vendor/local/gems/thread_safe-0.3.5-java/test/test_hash.rb
ivanvc-logstash-input-s3-3.1.1.3 vendor/local/gems/thread_safe-0.3.5-java/test/test_hash.rb
ivanvc-logstash-input-s3-3.1.1.2 vendor/local/gems/thread_safe-0.3.5-java/test/test_hash.rb
second_step-0.1.2 secondstep-notify-1.0.0-osx/lib/ruby/lib/ruby/gems/2.2.0/gems/thread_safe-0.3.5/test/test_hash.rb
logstash-filter-delta-1.1.0 vendor/bundle/jruby/2.2.0/gems/thread_safe-0.3.5-java/test/test_hash.rb
logstash-filter-delta-1.0.1 vendor/bundle/jruby/2.2.0/gems/thread_safe-0.3.5-java/test/test_hash.rb
logstash-filter-base64-1.0.4 vendor/bundle/jruby/2.2.0/gems/thread_safe-0.3.5-java/test/test_hash.rb
logstash-filter-base64-1.0.3 vendor/bundle/jruby/2.2.0/gems/thread_safe-0.3.5-java/test/test_hash.rb
logstash-filter-delta-1.0.0 vendor/bundle/jruby/2.2.0/gems/thread_safe-0.3.5-java/test/test_hash.rb
logstash-filter-base64-1.0.2 vendor/bundle/jruby/2.3.0/gems/thread_safe-0.3.5-java/test/test_hash.rb
logstash-filter-base64-1.0.1 vendor/bundle/jruby/2.3.0/gems/thread_safe-0.3.5-java/test/test_hash.rb
logstash-filter-base64-1.0.0 vendor/bundle/jruby/2.3.0/gems/thread_safe-0.3.5-java/test/test_hash.rb
able-neo4j-1.0.0 vendor/bundle/jruby/1.9/gems/thread_safe-0.3.5-java/test/test_hash.rb
ish_lib_manager-0.0.1 test/dummy/vendor/bundle/ruby/2.3.0/gems/thread_safe-0.3.5/test/test_hash.rb
angular-rails4-templates-0.4.1 vendor/ruby/2.1.0/gems/thread_safe-0.3.5/test/test_hash.rb
angular-rails4-templates-0.4.0 vendor/ruby/2.1.0/gems/thread_safe-0.3.5/test/test_hash.rb