in reply to Is this module safe to use -> Threads::Queue::Any

Currently I am using Threads::Queue and queuing a stiring with '|' delimited and spliting string after dequeing it.

That's the way I would do it also. The time taken to join & split the string is negligable compared to the overhead of locking involved in the transfer of the string from one thread to another. And far less than the overhead involve in Thread::Queue::Any.

It's simple. It works. And if things go wrong, it is easy to debug. Don't throw away that simplicity in search of something "more proper".

You might consider using $; as your join/split delimiter. It is less likely to appear in your data than '|'.


Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
"Science is about questioning the status quo. Questioning authority".
In the absence of evidence, opinion is indistinguishable from prejudice.
RIP an inspiration; A true Folk's Guy

Replies are listed 'Best First'.
Re^2: Is this module safe to use -> Threads::Queue::Any
by mr_p (Scribe) on Apr 16, 2010 at 17:10 UTC
    Thanks... for your reponse, I am not using join I am just using $str="abc|def|xyz";

    Also do you know how I can remove installed module?

      I am not using join I am just using $str="abc|def|xyz";

      At some point, if not already, 'abc', ''def' & 'xyz' won't be constants but rather contained in variables. At which point using $Q->enqueue( join $;, $abc, $def, $xyz ); starts to become prefereable.

      Also do you know how I can remove installed module?

      Depends how you installed it. If you used ppm/ppm-shell there is a 'remove' command. I don't think there is for cpan. If you did the 4-part mantra, then it would be a manual process.

      But there is no real reason to uninstall a module. Just stop using it. Next time you upgrade, you won't bother installing it. In the meantime, it just occupies a little disk.


      Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
      "Science is about questioning the status quo. Questioning authority".
      In the absence of evidence, opinion is indistinguishable from prejudice.
        I have another question on another topic, If you don't mind it.

        I have xml config file I am reading and I use XML Checker to validate against dtd.

        I went to cpan to download XML::Checker and it as in big red letters "UNAUTHORIZED" release. Is it a problem for me to use it, would u use it. I already have code to use it.

        Thanks for all your help.
        thre would be no delimiter for me to parse string once I dequeue If I used
        $Q->enqueue( join $;, $abc, $def, $xyz );