From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (from majordomo@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id KAA20409; Wed, 18 Sep 2002 10:14:08 +0200 (MET DST) X-Authentication-Warning: pauillac.inria.fr: majordomo set sender to owner-caml-list@pauillac.inria.fr using -f Received: from concorde.inria.fr (concorde.inria.fr [192.93.2.39]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id KAA20463 for ; Wed, 18 Sep 2002 10:14:07 +0200 (MET DST) Received: from athlon.baretta.com (host130-68.pool80116.interbusiness.it [80.116.68.130]) by concorde.inria.fr (8.11.1/8.11.1) with ESMTP id g8I8E6115401 for ; Wed, 18 Sep 2002 10:14:06 +0200 (MET DST) Received: from baretta.com (localhost.localdomain [127.0.0.1]) by athlon.baretta.com (Postfix) with ESMTP id 85113273C3 for ; Wed, 18 Sep 2002 10:23:18 +0200 (CEST) Message-ID: <3D8837F6.3060207@baretta.com> Date: Wed, 18 Sep 2002 10:23:18 +0200 From: Alessandro Baretta Organization: Baretta srl -- www.baretta.com User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.1) Gecko/20020826 X-Accept-Language: it, en MIME-Version: 1.0 To: Ocaml Subject: Re: [Caml-list] Client/Server socket communication References: <20020918115148K.ikeda@msi.co.jp> <20020918031351.4EC427F4F@lobus.fungible.com> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk Tim Freeman wrote: >>Why "server " is occurred. >>What do I have to do to correct ? > > > This is a Unix thing, not an OCAML thing. The child will be defunct > to hold the exit status so it can be reported to the parent when the > parent waits for it, or until the parent exits. > > One workaround is to wait for the child process when you expect it to exit. > > Another workaround is to fork twice, so the original process is the > parent of a temporary process, and the temporary process is the parent > of the process you really wanted to create. The temporary process > exits immediately and the original parent waits for it immediately. > This leaves no defunct processes. > A third workaround might be to use SIGCHLD handler to asynchronously call wait or waitpid, but there might be issues with the non-reentrance-with-respect-to-signals of the libc. I doubt O'Caml could be any more signal-safe than libc. A fourth workaround is to use O'Caml threads, which do not require the kernel to instantiate a new process, so no new pid is allocated. Alex ------------------- To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/ Beginner's list: http://groups.yahoo.com/group/ocaml_beginners