Hi Discipulus, you give me more credit than I deserve, in as far as being an expert on threads and forks. I'm just a hacker. :-)

However, to continue sharing my observations, there is one thing you overlook in the whole discussion. It's the problem of i/o to the disk or network when writing programs for parallel processing. I/O is very slow compared to how fast the cpu runs, and unless you are running an 8-core Xeon machine, with a T1 internet line, most of the cpu time in the program is wasted in waiting for the i/o to complete. That fact makes parallel processing a tricky proposition because you may waste more resources trying to fork and spawn threads than you gain in overall program efficiency. Newer software designs like node.js and Perl6 are designed to address this issue. The general solution is to run single threaded "event-loop" programs which handle the i/o with "promises" and callbacks. This is essentially how gui code, like Tk or Gtk+ runs. Node.js is just a single threaded event-loop program which listens on a socket .

There is a simple explanation of this at asynchronous Perl6 and the author of Perl6's MoarVM, has an easy to watch video on youtube -> Worthington on Parallel programs in Perl6

Of course, frameworks like MCE, parallel forks, and spawning worker threads are still very useful in certain circumstances, but in general, the software of the future will be event-loop based solutions.

Finally, most of us, have single core or a few core computers. On machines like these, parallel processing is usually just an exercise in coding, and dosn't really speed anything up.


I'm not really a human, but I play one on earth. ..... an animated JAPH

In reply to Re: parallel programming and MCE - hubris and the frame by zentara
in thread parallel programming and MCE - hubris and the frame by Discipulus

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.