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 WAA17127; Fri, 14 Nov 2003 22:22:12 +0100 (MET) 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 WAA16784 for ; Fri, 14 Nov 2003 22:22:11 +0100 (MET) Received: from herd.plethora.net (herd.plethora.net [205.166.146.1]) by concorde.inria.fr (8.11.1/8.11.1) with ESMTP id hAELM9118777 for ; Fri, 14 Nov 2003 22:22:10 +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 hAELM5C07353; Fri, 14 Nov 2003 15:22:05 -0600 (CST) Date: Fri, 14 Nov 2003 16:21:19 -0600 (CST) From: Brian Hurt X-X-Sender: bhurt@localhost.localdomain To: Eric Dahlman cc: caml-list@inria.fr Subject: Re: [Caml-list] GC and file descriptors In-Reply-To: <3FB5410F.8090008@atcorp.com> 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 profile:98 descriptors:01 descriptors:01 nov:01 failing:02 wrote:03 algorithm:03 allocate:03 redirect:95 efficient:05 brian:06 brian:06 loop:06 eric:06 Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk On Fri, 14 Nov 2003, Eric Dahlman wrote: > Another problem with doing this is that you are tying the rate at which > file descriptors are closed to the GC profile of your program. If you > only have 10's or 100's of file descriptors available it would be very > easy to use them all up in a tight loop which did not allocate much memory. > > It would be a bummer to have your program start failing because you used > a more memory efficient algorithm for some calculation. This is easy enough to work around- have the file open try a GC if the file open fails. Alternatively, you could simply require programs that want to sit in tight loops opening descriptors to handle the out of descriptors case. Java does #2, IIRC. -- "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