From: "Eric I." Date: 2007-10-14T04:35:02+09:00 Subject: Re: Is there a standard pattern for threaded access to a file? On Oct 13, 11:52 am, Simon Kröger wrote: > I think there will be a big (and probably long) "huh?" moment when running the > code: > > threads.each do |th| > # send the terminator and wait > queue.enq queue > th.join > end > > is more likely than not to never terminate. If another thread than th is eating > the terminator th.join will wait for a long time. Of course! Good catch! > never ever think wisdom will protect you against threads :) except if wisdom > tells you not to use them. I don't think I was claiming that it would protect you, but it sure helps. Eric ---- Are you interested in on-site Ruby training that uses well-designed, real-world, hands-on exercises? http://LearnRuby.com