English version
Accueil     À propos     Téléchargement     Ressources     Contactez-nous    

Ce site est rarement mis à jour. Pour les informations les plus récentes, rendez-vous sur le nouveau site OCaml à l'adresse ocaml.org.

Browse thread
[Caml-list] GC and file descriptors
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2003-11-14 (21:22)
From: Brian Hurt <bhurt@s...>
Subject: Re: [Caml-list] GC and file descriptors
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 

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