Version française
Home     About     Download     Resources     Contact us    
Browse thread
Freezing
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Eric Cooper <ecc@c...>
Subject: Re: [Caml-list] Freezing
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