From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on yquem.inria.fr X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=AWL autolearn=disabled version=3.1.3 X-Original-To: caml-list@yquem.inria.fr Delivered-To: caml-list@yquem.inria.fr Received: from concorde.inria.fr (concorde.inria.fr [192.93.2.39]) by yquem.inria.fr (Postfix) with ESMTP id C2D10BC6B for ; Wed, 6 Jun 2007 11:28:57 +0200 (CEST) Received: from einhorn.in-berlin.de (einhorn.in-berlin.de [192.109.42.8]) by concorde.inria.fr (8.13.6/8.13.6) with ESMTP id l569StqI017174 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=FAIL) for ; Wed, 6 Jun 2007 11:28:57 +0200 X-Envelope-From: oliver@first.in-berlin.de X-Envelope-To: Received: from first (dslb-088-073-088-113.pools.arcor-ip.net [88.73.88.113]) (authenticated bits=0) by einhorn.in-berlin.de (8.13.6/8.13.6/Debian-1) with ESMTP id l569SnoR031508 for ; Wed, 6 Jun 2007 11:28:52 +0200 Received: by first (Postfix, from userid 501) id 9ACC73D3DD5; Wed, 6 Jun 2007 11:28:40 +0200 (CEST) Date: Wed, 6 Jun 2007 11:28:40 +0200 From: Oliver Bandel To: caml-list@inria.fr Subject: Re: [Caml-list] re: We should all be forking Message-ID: <20070606092840.GH348@first.in-berlin.de> References: <20070605223047.GB30586@yumegakanau.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20070605223047.GB30586@yumegakanau.org> User-Agent: Mutt/1.5.6i X-Scanned-By: MIMEDefang_at_IN-Berlin_e.V. on 192.109.42.8 X-Miltered: at concorde with ID 46667E57.001 by Joe's j-chkmail (http://j-chkmail . ensmp . fr)! X-Spam: no; 0.00; bandel:01 in-berlin:01 osx:01 osx:01 unix:01 wrote:01 oliver:01 oliver:01 caml-list:01 kernel:01 philosophy:02 guess:04 fork:05 fork:05 tue:06 On Tue, Jun 05, 2007 at 03:30:47PM -0700, Christopher Cramer wrote: > 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. > [...] vfork is only (!!!) for a fork-exec combination. So, be aware: do not use vfork, if you don't exec right after it! Ciao, Oliver