From: Piyush Ranjan Date: 2009-12-18T02:51:10+09:00 Subject: Re: Using threads to show progress --001636833dfc342a48047af0448f Content-Type: text/plain; charset=ISO-8859-1 hmm..yes thats right. Did not think it through. Using queue may not be a good idea after all as you pointed out. After all queues are meant for asynchronous stuff and real time status update doesn't actually fit into that :) So is using two threads is the best solution ? On Thu, Dec 17, 2009 at 10:25 PM, Brian Candler wrote: > David Masover wrote: > > No, the problem isn't the queue itself, it's if you were to pass > > something > > non-thread-safe through the queue. > > Indeed. It's unwise to push the object through the queue, saying "I'm > currently working on this object", knowing that the other side could be > examining its state at the same time. > > You could pass the object you've just *finished* working on. Or else a > fresh object which has copies of the information required by the > consumer. > -- > Posted via http://www.ruby-forum.com/. > > --001636833dfc342a48047af0448f--