commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Johan Lindquist" <jo...@kawoo.co.uk>
Subject Re: [VFS] FileSystem close
Date Mon, 05 Jul 2004 10:54:08 GMT
On Mon, 05 Jul 2004 11:00:33 +0200, Mario Ivankovits <imario@apache.org>  
wrote:

>
> Well, this is my opinion too.
> I started by adding
>
> releaseUnusedResources()
>
> to the DefaultFileSystemManager. Unhappily i have had to adapt the  
> FileProvider too, so currently there are only a few fileSystems  
> (including sftp) capable of this.
> As said, you have to call close() on the fileObject to "detach" its  
> native resources, but the real "free" only happens on this  
> releaseUnusedResources call.

I already noticed the changes and downloaded them and it runs fine ...  
Thanks for the quick response :)

Btw, even if it is not implemented for all providers, it is only an issue  
where sockets/threads are opened for the file being used or?

> And there are more "threaded" aspects we have to take into account.
> Consider the situation you are using VFS.getManager() and two threads  
> reading/writing from/to the same fileobject. Now if one thread call  
> close() on the fileObject the streams are closed for the other thread  
> too.
> Looks like we "stired up a hornet's nest".
> <http://dict.leo.org/?p=14/p..&search=stir>

Yes, very true ...It easily gets "stired up" when adding concurrency :)

It would be too much though to keep track of each reference to the file  
(per resolveFile call) and not just the "opened" files or?

> Testers are very welcome. Please use the current nightly build (or cvs  
> source) and replace your close() by releaseUnusedResources(). However,  
> it is a good idea to stick on the ThreadLocal version too.
>

Will do - my next step will be to bind it to the thread ...

Thanks again for the quick response!

Johan


---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org


Mime
View raw message