Does your limited understanding of fork() come from windows?

On that platform, fork() is emulated using threads within a process, and if you want to start new processes, then you have to use OS specific calls (Win32::Process).

As tilly says, on unix like systems, fork clones your process to create two identical copies, one of which gets an arbitary label that says child.

The issues you have with zobmie processes, are simply that when a process quits, the OS keeps a record of it until the parent tells the OS that it is no longer interested in finding out what happened to it. There are system calls you can make to tell the OS that you are not interested in the fate of your child processes, so that it does not need to keep those records, then you won't get zombies.

I think the reason they are known as zombies, is untill they are reaped, they take up an entry in the process table, and on some older unixes, that table had limited space, so thousands of zombie processes could hurt performance, or even prevent new useful processes from starting.


In reply to Re: Forking vs. A New Process by chrestomanci
in thread Forking vs. A New Process by HalNineThousand

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.