From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Original-To: caml-list@yquem.inria.fr Delivered-To: caml-list@yquem.inria.fr Received: from nez-perce.inria.fr (nez-perce.inria.fr [192.93.2.78]) by yquem.inria.fr (Postfix) with ESMTP id 9EC67BB83 for ; Tue, 23 May 2006 15:24:17 +0200 (CEST) Received: from chokecherry.srv.cs.cmu.edu (CHOKECHERRY.SRV.CS.CMU.EDU [128.2.185.41]) by nez-perce.inria.fr (8.13.0/8.13.0) with ESMTP id k4NDOGIu011085 (version=TLSv1/SSLv3 cipher=EDH-RSA-DES-CBC3-SHA bits=168 verify=FAIL) for ; Tue, 23 May 2006 15:24:17 +0200 Received: from stratocaster.home (c-24-3-154-200.hsd1.pa.comcast.net [24.3.154.200]) (authenticated bits=0) by chokecherry.srv.cs.cmu.edu (8.13.5/8.13.5) with ESMTP id k4NDOFLB023595 (version=TLSv1/SSLv3 cipher=DES-CBC3-SHA bits=168 verify=NO) for ; Tue, 23 May 2006 09:24:15 -0400 (EDT) Received: from ecc by stratocaster.home with local (Exim 4.61) (envelope-from ) id 1FiWru-0004I0-Rk for caml-list@yquem.inria.fr; Tue, 23 May 2006 09:24:14 -0400 Date: Tue, 23 May 2006 09:24:14 -0400 To: caml-list@yquem.inria.fr Subject: Re: [Caml-list] Freezing Message-ID: <20060523132414.GC16364@localhost> Mail-Followup-To: caml-list@yquem.inria.fr References: <53c655920605221704r5ff97fdfj1fa953f6f858a8b1@mail.gmail.com> <1148353431.19894.19.camel@rosella.wigram> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1148353431.19894.19.camel@rosella.wigram> User-Agent: Mutt/1.5.11+cvs20060403 From: Eric Cooper X-Miltered: at nez-perce with ID 44730D00.000 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Spam: no; 0.00; unix:01 unix:01 waitpid:01 threads:01 wget:01 23,:98 2006:98 2006:98 wrote:01 wrote:01 caml-list:01 flush:03 let:03 fork:03 fork:03 X-Spam-Checker-Version: SpamAssassin 3.0.3 (2005-04-27) on yquem.inria.fr X-Spam-Level: X-Spam-Status: No, score=0.1 required=5.0 tests=FORGED_RCVD_HELO autolearn=disabled version=3.0.3 On Tue, May 23, 2006 at 01:03:51PM +1000, skaller wrote: > On Tue, 2006-05-23 at 02:04 +0200, David Baelde wrote: > > flush_all () ; > > let pid = Unix.fork () in > > if pid = 0 then begin > > ignore (Unix.alarm 20) ; > > Fetch.cp there here ; > > exit 0 > > end else > > Unix.waitpid [] pid > [...] > The moral is -- use threads or processes but not both > together, Unix can't handle it. Or at least, don't use fork without an almost-immediate exec. In this particular case, the OP might consider using exec to run a standalone program in the child -- perhaps cp or wget -- if there's not a lot of state shared with the parent. -- Eric Cooper e c c @ c m u . e d u