Good day, monks. I've seen some of the old discussion threads about the virtues/short-comings of perl's implementation of ithreads, and was wondering if changes released since most of these discussions (late '03) have converted any of the fork devotees.

To summarize what I got out of earlier talks, my impression was that perl's non-COW address space copying with ithreads made them actually "heavier" than the optimized fork() routines on most *nix systems. Data sharing was more convenient, but otherwise ithreads seemed to be frowned upon. Liz's forks.pm package, which implements the threads.pm interface using forks and sockets, seemed the more popular approach.

Now, admittedly, looking at the release notes, it seems like all we've really gotten is memory leak fixes for ithreads, not performance help. Nevertheless, when I run the same code with "use threads" vs "use forks", I get better perf with threads, regardless of any sharing. I'm still working on getting reliable cpu time numbers (it's tough to track child processes), but wall clock time on the same system is consistently faster for threads, and threads get 1/4 the page faults (more or less).

Does this seem consistent with what others would expect? Thanks.


In reply to latest on ithreads vs forks? 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.