From: Tim Pease Date: 2007-11-29T09:37:11+09:00 Subject: ThreadGroup and Ruby 1.9 Just wondering if this is a bug in 1.9 or intended behavior ... $ cat a.rb tg = ThreadGroup.new t = Thread.new { sleep 3600 } tg.add t puts "tg = #{tg.list.inspect}" puts "default = #{ThreadGroup::Default.list.inspect}" sleep 0.1 tg.add t puts "tg = #{tg.list.inspect}" puts "default = #{ThreadGroup::Default.list.inspect}" Now we run this little script in Ruby 1.8 and get the following output ... $ ruby a.rb tg = [#] default = [#] tg = [#] default = [#] Our thread group contains one thread, and the default thread group contains one thread -- all is happy. Now we run this little script in Ruby 1.9 and get the following output ... $ /usr/local/ruby1.9/bin/ruby a.rb tg = [] default = [#, #] tg = [#] default = [#] It appears that the first call to ThreadGroup#add fails. The second call works because the thread "t" has actually been started by the ruby interpreter -- this happened when we called sleep. Any thoughts on this one? Blessings, TwP