NOTICE: This version of the NSF Unidata web site (archive.unidata.ucar.edu) is no longer being updated.
Current content can be found at unidata.ucar.edu.

To learn about what's going on, see About the Archive Site.

Re: [netcdf-java] Variable object thread safe?

Ah, I see, good to know.
Jon

On Tue, Sep 16, 2008 at 4:39 PM, John Caron <caron@xxxxxxxxxxxxxxxx> wrote:
>
>
> Jon Blower wrote:
>> So presumably if you use the NetCDF file cache, you have to do the
>> synchronization yourself, since you might be transparently sharing
>> file handles?  That's an aspect of the cache that hadn't occurred to
>> me before...
>
> The way that the cache is designed to work is that you get back a NetcdfFile 
> object, which should then used only in a single thread so you dont need 
> synchronization ("thread-confinement"), such as to answer a single request in 
> a server. Until you release that NetcdfFile object, no one else can get it 
> from the cache. If another request is made for that same NetcdfFile while its 
> locked, a new NetcdfFile is opened.
>
> And of course, the cache itself is thread-safe. So if you use it properly, 
> you never have to do synchronization yourself.
>



-- 
Dr Jon Blower
Technical Director, Reading e-Science Centre
Environmental Systems Science Centre
University of Reading
Harry Pitt Building, 3 Earley Gate
Reading RG6 6AL. UK
Tel: +44 (0)118 378 5213
Fax: +44 (0)118 378 6413
j.d.blower@xxxxxxxxxxxxx
http://www.nerc-essc.ac.uk/People/Staff/Blower_J.htm


  • 2008 messages navigation, sorted by:
    1. Thread
    2. Subject
    3. Author
    4. Date
    5. ↑ Table Of Contents
  • Search the netcdf-java archives: