This is the mail archive of the
java-patches@gcc.gnu.org
mailing list for the Java project.
Re: [Patch] PR 31228, Fix close-on-exec race.
David Daney writes:
> Andrew Haley wrote:
> > David Daney writes:
> > > How about this version?
> >
> > This is impressively heroic, but I really think you should measure the
> > performance improvement before committing this. :-)
>
> Hard data takes the fun out of things :-(
Haha! I am *such* a scientist! :-)
> What does all this mean? Well on my x86_64-pc-linux-gnu notebook,
> it takes about 1 second to close 10,000,000 times an invalid file
> descriptor. The savings of only closing open files would appear to
> make sense only if the default ulimit -n value is raised to a value
> greater than about 3000.
>
> The only reason to increase ulimit -n, from its default value of
> 1024, is if you expect to have a lot of open files. In this case
> This is all moot as the time to close the open files would be much
> greater than the overhead of closing invalid descriptors.
>
> So if we want to fix the bug, I would recommend my original patch.
Yeah, we want to fix the bug. This is OK.
Andrew.