On 12/03/2008, at 15.50, Marc Haisenko wrote:
> On Wednesday 12 March 2008, Jon Bendtsen wrote:
>> Q) why brute force close all files?
>> a) ask the kernel to close all my open files
>> b) ask the kernel which files do I have open and then close only
>> those
>> c) remember what files i have open and then close only those
>
> This problem may sound easy but is quite tricky to solve: there's no
> portable
> solution for a) and b), and c) is not reliable. For example, on
> Linux I think
> there's no way for a), and b) would most likely have to rely on
> analyzing /proc/*/fd. But this won't work on systems like FreeBSD or
> Mac OS X
> which don't have /proc.
Then you use an ifdef linux? just like Phil suggested.
> This is why several UNIX applications do the brute force way. But it
> may be a
> good idea to limit it. It's highly unlikely that SubVersion would
> have more
> than say 128 file handles open, with a safety factor let's make that
> 1024. If
> by chance there really ARE more than 1024 file descriptors open you
> propably
> have bigger problems than not having all file descriptors closed ;-)
I did limit it to 1024, and it appears to be much faster now, so users
doesnt complain.
JonB
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe_at_subversion.tigris.org
For additional commands, e-mail: users-help_at_subversion.tigris.org
Received on 2008-03-13 16:24:47 CET