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 DAA26066; Sat, 15 Nov 2003 03:33:00 +0100 (MET) X-Authentication-Warning: pauillac.inria.fr: majordomo set sender to owner-caml-list@pauillac.inria.fr using -f Received: from nez-perce.inria.fr (nez-perce.inria.fr [192.93.2.78]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id DAA26081 for ; Sat, 15 Nov 2003 03:32:59 +0100 (MET) Received: from dali.cis.ru (dali.cis.ru [212.109.192.9]) by nez-perce.inria.fr (8.11.1/8.11.1) with ESMTP id hAF2Ww116040 for ; Sat, 15 Nov 2003 03:32:58 +0100 (MET) Received: from max1.home (pax2-200.cis.ru [212.109.194.200]) by dali.cis.ru (8.12.2/8.12.2/dali-2.0) with SMTP id hAF2WcCS095505 for ; Sat, 15 Nov 2003 08:32:53 +0600 (NOVT) Received: (qmail 30085 invoked by uid 100); 15 Nov 2003 02:25:21 -0000 Date: Sat, 15 Nov 2003 08:25:21 +0600 From: Max Kirillov To: caml-list@inria.fr Subject: Re: [Caml-list] GC and file descriptors Message-ID: <20031115082521.A12540@max.home> Mail-Followup-To: caml-list@inria.fr References: <70D8AC5D-16A8-11D8-BFCA-00039310CAE8@inria.fr> <3FB4ED56.6020804@univ-savoie.fr> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5i In-Reply-To: ; from dbely@mail.ru on Fri, Nov 14, 2003 at 11:24:21PM +0300 X-Sender: Max X-Loop: caml-list@inria.fr X-Spam: no; 0.00; kirillov:01 caml-list:01 raffalli:01 raffalli:01 univ-savoie:01 subprocesses:01 bug:01 faq:01 faq:01 beginner's:01 beginners:01 bin:01 christophe:01 christophe:01 caml-bugs:01 Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk On Fri, Nov 14, 2003 at 11:24:21PM +0300, Dmitry Bely wrote: > Christophe Raffalli writes: > >>>> Garbage collecting the subprocesses and file descriptors would >>>> make this a bit more straightforward. >>> The problem with this approach is that the "close" and "wait" >>> system calls have side effects. I don't like the idea of a GC >>> that has side effects other than the memory size of the program >>> (and finalisation functions, of course). >> >> Why ? Could you elaborate ? > > close() can fail (generate an exception). How are you going to handle it in According to 'man 2 close', it cannot. Nearly the same is true for any resource deallocation. The only exception I can recall is wait -- but, when you don't need the exit status (and you surely don't, once you leave it to GC), you can ignore all the errors. Of course here might be a questions wish unflushed data. But still, if you don't flush the writing channel before finishing a function, you probably don't need you output to be delivered in any case. > the garbage collector? On the contrary, the memory deallocaton always > succeeds. > - Dmitry Bely > > > ------------------- > 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 > -- Max ------------------- 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