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?

John Caron wrote:
> Hi Stuart:
> 
> Underneath a Variable/NetcdfFile is (usually) a java.io.RandomAccessFile 
> object, which is not thread-safe, because it keeps the state of the file 
> position. So even if all you want to do is read data in multiple threads, you 
> need to synchronize, typically on the NetcdFile object. Alternatively, open a 
> new NetcdfFile for each thread. The Threads Data Server (TDS) uses a cache of 
> open NetcdfFile files by using the NetcdfFile.acquire() method, which allows 
> stateless handling of data requests minimizing file opening and closing..

Sorry that should have been NetcdfDataset.acquireFile()


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