I have a shiny new desktop with two quad processors.

As others have said, you are under a misconception about threads. Just because you have 2 processors, dosn't mean that all programs will automatically be run in some sort of shared-cpu manner. For that matter, even if you "use threads" in a Perl script, your kernel may decide to run all threads with one cpu. Multi-threading as you envision it, is done in the kernel, and it takes specialized c programs to utilize it to it's full potential. Your single or multi-threaded Perl program is at the mercy of the kernel, when it runs. Google for "linux multi cpu scheduling" and "linux multi cpu scheduling Perl" and you will see what is happening. If you are not an expert programmer( as is the case with most of us), you are jumping into very deep water, and you will conclude that it isn't worth the time learning to override the kernel's design, unless you are doing some extremely intensive number crunching on a super-computer. Is saving a few milliseconds of execution time worth the many hours of learning required to force dual-cpu usage?


I'm not really a human, but I play one on earth CandyGram for Mongo

In reply to Re: Runing "regular" code with threaded perl by zentara
in thread Runing "regular" code with threaded perl by kingskot

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.