Here's my take on it:

I learned perl using the Camel, starting at the beginning.. Threads have more coverage there than forking, in fact, forking is mentioned only as a way of doing interprocess communication. Which would make sense to me, were I aiming to create separate processes, which I havent wanted to do, yet.. (Actually I did once, but then I just split my program into two, and communicated using sockets, which was easier in the end..)

I don't come from a unix/C background, so I've no history of forks, the why and how of them, and since threading works fine for me, I'll continue to use it (both 5005 and ithreads)

None of this says if threads are better than forks, or vice versa, the only thing I know about forks is that it seems to be more difficult to communicate between forked processes (using Thread::Queue or shared vars in threads is easy..) So, no clue there.

I'd say, threads for self-contained programs in which the threaded bits need to communicate, and forks for extra processes which do something entirely separate.. I'd assume that people use forks for things I'd use threads for just because perl threads weren't seen as any good for a long time, but that's probably just my opinion :)

C.

(Nodes are threaded, not forked, here, makes perfect sense to me :)


In reply to Re: Why use threads over processes, or why use processes over threads? by castaway
in thread Why use threads over processes, or why use processes over threads? by pg

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.