From: Lune Lune Date: 2010-01-22T19:17:11+09:00 Subject: Re: SizedQueue Hi Robert Thanks for your example. I wanted to play with it to really understand how that works. So I tried this : QUEUE = Queue.new threads = (1..5).map do |a| Thread.new(QUEUE) do |q| until ( q == (task = q.deq)) print "thread-", a, " ", task.inspect, "\n" end end end 10.times do |t| puts "t #{t}" 30.times { |s| puts "s #{s}"; QUEUE.enq(s) } threads.size.times { QUEUE.enq QUEUE } threads.each {|t| t.join} end In my loop "30 times" 5 * 6 threads are created. But when I add "10 times" I should see 10 * what I had earlier. This is not happening. I have my 5 * 6 threads created and that's all. Could you explain why ? Thanks -- Posted via http://www.ruby-forum.com/.