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 <b.candler / pobox.com> 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/.
>
>