From: "Simon Kröger" Date: 2007-10-14T00:55:02+09:00 Subject: Re: Is there a standard pattern for threaded access to a file? Eric I. schrieb: > That's a very nice solution. It demonstrates a lot of accumulatd > wisdom. I think I'd use a symbol in the queue, such as :end_of_data, > rather than the queue itself to mark the end of the data, if only to > avoid a "huh?" moment from those who read the code down the line. 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. > Eric cheers Simon never ever think wisdom will protect you against threads :) except if wisdom tells you not to use them.