Version française
Home     About     Download     Resources     Contact us    
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: -- (:)
From: John J Lee <jjl@p...>
Subject: Re: [Caml-list] GC and file descriptors
On Fri, 14 Nov 2003, Brian Hurt wrote:

> On Fri, 14 Nov 2003, Eric Dahlman wrote:
[...]
> > 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.
[...]
> 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
[...]

File descriptors can be a globally limited resource, though, can't they?
If your program uses them all up, other programs can't get one either.

Also, does O'Caml *always* GC objects?  If they're un-GC-ed at time of
program exit, will they still be GC-ed, or does O'Caml just leave it to
the OS to clean up in that case?  If it leaves it to the OS, files could
be left open, and I'm not sure it's guaranteed that having files open for
writing at program exit won't cause data loss.


John

-------------------
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