in reply to Re: Sharing (blessed)? references with Thread::Queue.
in thread Sharing (blessed)? references with Thread::Queue.

Liz,

Thanks a ton for the references! (I assume you are the author of said modules?)

I think Thread::Queue::Any is what I am looking for, so I'll try that. Is it fair to say that an ordinary Thread::Queue is not capable of doing what I want it to?

Preston

  • Comment on Re: Re: Sharing (blessed)? references with Thread::Queue.

Replies are listed 'Best First'.
Re: Re: Re: Sharing (blessed)? references with Thread::Queue.
by liz (Monsignor) on Jan 07, 2004 at 20:05 UTC
    Thanks a ton for the references! (I assume you are the author of said modules?)

    Eh... yes, I think so... ;-)

    I think Thread::Queue::Any is what I am looking for, so I'll try that. Is it fair to say that an ordinary Thread::Queue is not capable of doing what I want it to?

    I'm not 100% sure that Thread::Queue::Any can do what you want. Even though you can pass references to Thread::Queue::Ant, you are in fact copying the structure that lies behind the reference. So any change you make in one thread will not seen in the other threads. I couldn't make out from your example whether that is what you wanted or not.

    Liz

      I noticed that caveat in your documentation, but I can work around it. I also noticed that if a blessed structure is enqueued, the dequeued structure is also blessed (as a nice consequence of Storable I suppose). Very useful..thanks for the idea!

      What I Want (tm) is the "Any" of Thread::Queue::Any and the shared nature of Thread::Queue. Looking at the implementation of Any.pm, I see that it does..well..exactly what you said it does, and that I can't just make some quick hacks to make this happen. Oh well..

      Anyway, I perused your page on CPAN a little and noticed some other juicy stuff that I'll have to play with. I owe you a $beverage. :)

      Preston