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 VAA15595; Fri, 14 Nov 2003 21:49:24 +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 VAA15396 for ; Fri, 14 Nov 2003 21:49:23 +0100 (MET) Received: from herd.plethora.net (herd.plethora.net [205.166.146.1]) by nez-perce.inria.fr (8.11.1/8.11.1) with ESMTP id hAEKnM100956 for ; Fri, 14 Nov 2003 21:49:23 +0100 (MET) Received: from bhurt.plethora.net (bhurt.plethora.net [205.166.146.49]) by herd.plethora.net (8.11.6/8.10.1) with ESMTP id hAEKnDC05979; Fri, 14 Nov 2003 14:49:14 -0600 (CST) Date: Fri, 14 Nov 2003 15:48:27 -0600 (CST) From: Brian Hurt X-X-Sender: bhurt@localhost.localdomain To: Dmitry Bely cc: caml-list@inria.fr Subject: Re: [Caml-list] GC and file descriptors In-Reply-To: Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Loop: caml-list@inria.fr X-Spam: no; 0.00; caml-list:01 abort:01 ocaml's:01 aborting:01 garbage:01 dmitry:01 descriptors:01 nov:01 bely:01 exception:02 exception:02 collector:02 uncaught:02 thread:02 manually:03 Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk On Fri, 14 Nov 2003, Dmitry Bely wrote: > close() can fail (generate an exception). How are you going to handle it in > the garbage collector? On the contrary, the memory deallocaton always > succeeds. Two choices: either abort the whole program (uncaught exception), or ignore it. Ocaml's life is a little easier, as GC takes place inside the single thread of execution. But I dislike making the language spec require that. Now, *which* of those two choices is "correct" is a matter for some debate. Myself, I like aborting the whole program. What I dislike is resource leaks- as plugging the holes manually can often be tricky. If I wanted to hand-manage resource deallocation, I'd be programming in C (well, not quite- but the point is made). -- "Usenet is like a herd of performing elephants with diarrhea -- massive, difficult to redirect, awe-inspiring, entertaining, and a source of mind-boggling amounts of excrement when you least expect it." - Gene Spafford Brian ------------------- 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