caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Christopher Cramer <tsuyoshi@yumegakanau.org>
To: caml-list@inria.fr
Subject: re: We should all be forking
Date: Tue, 5 Jun 2007 15:30:47 -0700	[thread overview]
Message-ID: <20070605223047.GB30586@yumegakanau.org> (raw)

Jon Harrop:
> I believe the performance relies upon the Linux kernel lazily copying
> the process. Does OSX also do that? 

It's called copy-on-write and I would be surprised if OSX didn't also
do it.

The only way to start a new process is to fork, so even if you're just
running another program you fork first, and then replace the process
image with the new program with exec. If the fork had to copy the entire
process image before just throwing it away upon exec, I think Unix,
which is based around a philosophy of piping between multiple processes,
would have abandoned fork a long time ago. Then again, there is vfork,
so I guess they almost did abandon it at one point.

This method doesn't work well at all on Windows, as I understand
it.

BTW your code looks a lot nicer than mine. The |> is brilliant, I think.
I'm a little surprised you cut the speed in half without using select.
And looking at your code I just realized I have a bug in mine...


             reply	other threads:[~2007-06-05 22:30 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-06-05 22:30 Christopher Cramer [this message]
2007-06-05 22:53 ` [Caml-list] " Eric Cooper
2007-06-06  9:28 ` Oliver Bandel
2007-06-06 17:51   ` Shawn W.
  -- strict thread matches above, loose matches on Subject: below --
2007-06-05 18:13 Jon Harrop

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20070605223047.GB30586@yumegakanau.org \
    --to=tsuyoshi@yumegakanau.org \
    --cc=caml-list@inria.fr \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).