caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
* re: We should all be forking
@ 2007-06-05 22:30 Christopher Cramer
  2007-06-05 22:53 ` [Caml-list] " Eric Cooper
  2007-06-06  9:28 ` Oliver Bandel
  0 siblings, 2 replies; 4+ messages in thread
From: Christopher Cramer @ 2007-06-05 22:30 UTC (permalink / raw)
  To: caml-list

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...


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2007-06-06 17:50 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-06-05 22:30 We should all be forking Christopher Cramer
2007-06-05 22:53 ` [Caml-list] " Eric Cooper
2007-06-06  9:28 ` Oliver Bandel
2007-06-06 17:51   ` Shawn W.

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).