My question was, why I've different values for two different approaches? And for that question I didn't get an answer, not even some clues,

To get an answer to that question, you have to actually ask it. But you didn't.

The only question you asked was:

Should we use Thread::Queue::Any instead of Thread::Queue?

Which is a very reasonable question.

And if your results were correct, meaningful and valid, then the answer would have been a resounding use T::Q::A. But your benchmark is invalid; which renders any results it produces meaningless; and the results you posted are bogus.

There is simply no way T::Q::A could ever be faster or use less lock states than T::Q, since T::Q::A use T::Q, and therefore does everything T::Q does + (LOTS OF SLOW STUFF) more!

So the answer to the question you actually asked is: T::Q can do everything T::Q::A can do, and do it more quickly, with an identical number of lock states. There is therefore, absolutely no reason to ever use the latter. (Is that clear enough?)


Now, back to that new and originally unasked question: "why I've different values for two different approaches?".

And the answer is: Because they are different!

For the detail of why they are different, see my original answer which goes to great lengths to explain it.


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 PCW

In reply to Re^3: Thread::Queue vs Thread::Queue::Any by BrowserUk
in thread Thread::Queue vs Thread::Queue::Any by gulden

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.