"How is that better than fork()?

It's not better than fork(), just different. It's closer to exec(3).

For some uses, those typified by the fork&exec pattern, CreateProcess() can be said to be better. Why bother duplicating (even minimal) information and data from the current process if the next thing you are going to do is throw almost all of it away to do the exec.

For other uses, fork comes into its own. Like airplanes and helicopters, they both achieve similar goals; they just approach them from different angles.

I've often wished that WinAPI had a proper built-in fork. It wouldn't be hard to add it internally to the OS. I think the reason it doesn;t exist is more political than practical.

Hell, it's almost(*) possible using the published API's, including COW and the other subtleties, there is just a soupçon of missing functionality that prevents it being done efficiently as a third-party library.

(*)I'm aware that both cygwin (and that MS toolkit I've forgotten the name of) provide such an api, but only in the context of a POSIX(1) emulation layer and they are not (even vaguely) efficient.


With the rise and rise of 'Social' network sites: 'Computers are making people easier to use everyday'
Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
"Science is about questioning the status quo. Questioning authority".
In the absence of evidence, opinion is indistinguishable from prejudice.

The start of some sanity?


In reply to Re^5: Windows System Command by BrowserUk
in thread Windows System Command by Ransom

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.