Actions
Bug #8374
closedrace condition when two threads require a gem
Description
=begin
Requiring a gem with a C extension seems to be not threadsafe.
Any one of the require lines below will frequently (but not always) cause an error like the following:
/usr/local/lib/ruby/site_ruby/2.0.0/rubygems/core_ext/kernel_require.rb:45:in require': cannot load such file -- sqlite3 (LoadError) from /usr/local/lib/ruby/site_ruby/2.0.0/rubygems/core_ext/kernel_require.rb:45:in
require'
from thread.rb:7:in `block (2 levels) in '
Using one thread avoids the problem.
ths = (1..2).map do
Thread.new do
require 'msgpack'¶
require 'yajl'¶
require 'sequel'¶
require 'nio4r'¶
require 'sqlite3'
end
end
ths.each {|th| th.join}
=end
Actions
Like0
Like0Like0Like0