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.
In reply to Re^3: Thread::Queue vs Thread::Queue::Any
by BrowserUk
in thread Thread::Queue vs Thread::Queue::Any
by gulden
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |