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=none autolearn=disabled version=3.1.3 Received: from concorde.inria.fr (concorde.inria.fr [192.93.2.39]) by yquem.inria.fr (Postfix) with ESMTP id 88DE8BC69 for ; Wed, 30 May 2007 21:45:35 +0200 (CEST) Received: from sccmmhc91.asp.att.net (sccmmhc91.asp.att.net [204.127.203.211]) by concorde.inria.fr (8.13.6/8.13.6) with ESMTP id l4UJjYvo001746 for ; Wed, 30 May 2007 21:45:35 +0200 Received: from [192.168.0.104] (12-208-242-210.client.mchsi.com[12.208.242.210]) by sccmmhc91.asp.att.net (sccmmhc91) with SMTP id <20070530194533m9100d37aoe>; Wed, 30 May 2007 19:45:33 +0000 Mime-Version: 1.0 (Apple Message framework v752.3) References: <5F7D2956-2B0A-465A-8AC2-06D7EDC457F9@valdosta.edu> Content-Type: text/plain; charset=US-ASCII; delsp=yes; format=flowed Message-Id: <4C7DF773-3B6F-464F-8D90-CE240B91AEE5@valdosta.edu> Content-Transfer-Encoding: 7bit From: Jonathan Bryant Subject: Fwd: [Caml-list] Faking concurrency using Unix forks and pipes Date: Wed, 30 May 2007 15:44:23 -0400 To: caml-list@yquem.inria.fr X-Mailer: Apple Mail (2.752.3) X-Miltered: at concorde with ID 465DD45E.000 by Joe's j-chkmail (http://j-chkmail . ensmp . fr)! X-Spam: no; 0.00; forks:01 ocaml:01 forks:01 marshaling:01 marshaled:01 beginner's:01 ocaml:01 bug:01 2007,:98 goat:98 heap:01 unix:01 unix:01 beginners:01 wrote:01 Oops. Forgot to CC the list... Begin forwarded message: > From: Jonathan Bryant > Date: May 30, 2007 3:43:50 PM EDT > To: Erik de Castro Lopo > Subject: Re: [Caml-list] Faking concurrency using Unix forks and pipes > > > On May 30, 2007, at 3:14 PM, Erik de Castro Lopo wrote: > >> >> To exploit multi-process message-passing style concurrency you >> need to >> fork early before much has been allocated. > > What I've always done to get around this is fork a process at the > very beginning of the code, and whenever I need to fork a process > later, I fork one from that process. That way almost nothing is in > the heap. I do have worries about the efficiency of this though: > when marshaling a closure across a socket to another process, it > must marshal all the necessary state as well. I would imagine this > has the potential to get slow if there was much state to marshal > (i.e., a closure marshaled referencing a large data structure). > > --Jonathan > >> >> Erik >> -- >> ----------------------------------------------------------------- >> Erik de Castro Lopo >> ----------------------------------------------------------------- >> "... a discussion of C++'s strengths and flaws always sounds >> like an argument about whether one should face north or east >> when one is sacrificing one's goat to the rain god." >> -- Thant Tessman >> >> _______________________________________________ >> Caml-list mailing list. Subscription management: >> http://yquem.inria.fr/cgi-bin/mailman/listinfo/caml-list >> Archives: http://caml.inria.fr >> Beginner's list: http://groups.yahoo.com/group/ocaml_beginners >> Bug reports: http://caml.inria.fr/bin/caml-bugs >