I've different results depending on the OS and on the HW. Below you can see the results. This behaviour is more than strange, and the only conclusion that I can take from this, is that the Perl Thread implementation have lots of LOCKs inside that is far from being good, with unexpected behaviour and that limits us when we focus on threaded performance programs developed in Perl. At so far, no one in this forum have showed a clear knowledge in Perl Threads implementation. If so, they would explain me clearly why I'm getting such results.

The usage of Perl Threads is negligible like the Perl Threads Community, should we use Perl Threads? Is it robust enough and trustful in order to be used in production environments? Do we have support from the community? What we do when we have a Multi Core CPU Server with 64 "CPUs" and when we run a threaded simple Perl program, with 16 Threads, only using simple REGEX's, without sharing nothing to avoid LOCKs, and the CPU stats shows lots of locks with a CPU usage of 20% and higer values for VCX's? And we say WTF? I've to reimplement my code? or replace REGEXs with some ingenious code, or avoid Modules/Classes, or avoid implementing functions or ... or avoid writing a single line of code!!Yeah change the Programming Language is also an option...

You may say that Threads is only useful for latency-bound problems not for throughput-bound problems. Ok, in that case the only thing I have to do is to put the Perl Program Running, go to my house and take a long, very long snap, while my Perl program uses only one "CPU" when I'm having "64" available.

--------------------------------------- OS=Fedora 10 , Perl version = 5.10.0 --------------------------------------- $ perl -MThread::Queue::Any -e 'print $Thread::Queue::Any::VERSION."\n +"' 0.09 $ perl -Mthreads -e 'print $threads::VERSION."\n"' 1.73 $ perl -MThread::Queue -e 'print $Thread::Queue::VERSION."\n"' 2.11 Results: - TEST QUEUE:21(seconds) - TEST QUEUE Any:8(seconds) --------------------------------------- OS=Fedora 7 (Running on coLinux) , Perl version = 5.8.8 --------------------------------------- $ perl -MThread::Queue::Any -e 'print $Thread::Queue::Any::VERSION."\n +"' 0.09 $ perl -Mthreads -e 'print $threads::VERSION."\n"' 1.72 $ perl -MThread::Queue -e 'print $Thread::Queue::VERSION."\n"' 2.11 Results: - TEST QUEUE:14(seconds) - TEST QUEUE Any:20(seconds) --------------------------------------- OS=Solaris 10, Perl version = 5.8.8, CPU Intel --------------------------------------- $ perl -MThread::Queue::Any -e 'print $Thread::Queue::Any::VERSION."\n +"' 0.09 $ perl -Mthreads -e 'print $threads::VERSION."\n"' 1.72 $ perl -MThread::Queue -e 'print $Thread::Queue::VERSION."\n"' 2.11 Results: - TEST QUEUE:11(seconds) - TEST QUEUE Any:13(seconds) --------------------------------------- OS=Solaris 10, Perl version = 5.8.8, CPU Intel --------------------------------------- $ perl -MThread::Queue::Any -e 'print $Thread::Queue::Any::VERSION."\n +"' 0.09 $ perl -Mthreads -e 'print $threads::VERSION."\n"' 1.73 $ perl -MThread::Queue -e 'print $Thread::Queue::VERSION."\n"' 2.11 Results: - TEST QUEUE:11(seconds) - TEST QUEUE Any:13(seconds) --------------------------------------- OS=Solaris 10, Perl version = 5.8.8, CPU Ultra SPARC --------------------------------------- $ perl -MThread::Queue::Any -e 'print $Thread::Queue::Any::VERSION."\n +"' 0.09 $ perl -Mthreads -e 'print $threads::VERSION."\n"' 1.73 $ perl -MThread::Queue -e 'print $Thread::Queue::VERSION."\n"' 2.11 Results: - TEST QUEUE:52(seconds) - TEST QUEUE Any:27(seconds)

«A contentious debate is always associated with a lack of valid arguments.» -- Show respect to be respected.


In reply to Re: Thread::Queue vs Thread::Queue::Any by gulden
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.