Unless you are running on a multiprocessor box or a cluster, 'parallel' really just means multiprocessing. If you fork coprocesses, they can get their own time slice whenever they are ready to run, so your job effectively gets more time from the system.
Good point. My first reaction upon reading the question was that forking and threading can improve your performance ONLY when you've got tasks that have a lot of 'waiting time', such as retrieving a bunch of files over a network. Your point about there being more timeslices for the code when spread over more processes proved me wrong before making an ass of myself in public :-)

I do wonder if this makes a lot of difference when you don't have a lot of other processes running though, and wheter you cannot get the same sort of gain when you up (or lower, however you look at it) the priority on the process. Does anyone have any pointers to benchmarks/articles on this subject?

-- Joost downtime n. The period during which a system is error-free and immune from user input.

In reply to Re: Re: How do I run subroutines in parallel? by Joost
in thread How do I run subroutines in parallel? by Anonymous Monk

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.