This is the mail archive of the
java@gcc.gnu.org
mailing list for the Java project.
Re: System.gc() to close file descriptors (was RE: status of gcj's bo ehm collector?)
- From: Tom Tromey <tromey at redhat dot com>
- To: "Boehm, Hans" <hans_boehm at hp dot com>
- Cc: "'Andrew Haley'" <aph at cambridge dot redhat dot com>, "'Adam Megacz'" <gcj at lists dot megacz dot com>, java at gcc dot gnu dot org
- Date: 14 Dec 2001 13:42:55 -0700
- Subject: Re: System.gc() to close file descriptors (was RE: status of gcj's bo ehm collector?)
- References: <40700B4C02ABD5119F000090278766443BEDFE@hplex1.hpl.hp.com>
- Reply-to: tromey at redhat dot com
>>>>> "Hans" == Boehm, Hans <hans_boehm@hp.com> writes:
Hans> I looked at the gcj code a little more closely.
Hans> System.runFinalization() also seems to have two other problems:
I think we should get in the habit of reporting all these sorts of
things to Gnats; we've dropped too many issues like this in the past.
Andrew, are you still looking at this?
Hans> 1. BufferedOutputStreams and the like are not flushed if the
Hans> file descriptor is dropped and finalized (or if it persists
Hans> until process exit).
The spec doesn't address this.
One idea would be to reverse-engineer Sun's implementation.
I don't think client code can rely on anything here though.
Hans> 2. There seems to be a minor problem with finalization of
Hans> FileDescriptors. They are closed only if they are still open,
Hans> but the test and the close are done without synchronization.
Thanks.
Tom