From: Michael Neumann Date: 2002-05-27T21:33:45+09:00 Subject: Re: SizedQueue.new(0) On Mon, May 27, 2002 at 09:12:35PM +0900, Lars Christensen wrote: > > Is this a bug in Ruby or my brain? :-) > > $ sizedqueue.rb > quire 'thread.rb' > q = SizedQueue.new(0) > Thread.start { q.pop } > q.push 1 Maybe it has something to do that you define an empty queue? This works: q = SizedQuere.new(n) # n > 0 > $ ruby sizedqueue.rb > deadlock 0x80fb99c: 2:0 - /pack/ruby-1.6.7/lib/ruby/1.6/thread.rb:184 > deadlock 0x8105d98: 2:0 (main) - /pack/ruby-1.6.7/lib/ruby/1.6/thread.rb:253 > /pack/ruby-1.6.7/lib/ruby/1.6/thread.rb:253:in `stop': Thread: deadlock (fatal) > from /pack/ruby-1.6.7/lib/ruby/1.6/thread.rb:253:in `push' > from sizedqueue.rb:4 > > Or is there an easier way to do job/thread multiplexing without a queue? I.e. > to have all pushers block until someone pops. -- Michael Neumann *** eMail uu9r@rz.uni-karlsruhe.de