Unidata - To provide the data services, tools, and cyberinfrastructure leadership that advance Earth system science, enhance educational opportunities, and broaden participation. Unidata
         
  advanced  
 

Netcdf-Java FAQ

Q: Is the Netcdf-Java library thread-safe?

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 NetcdfDataset.acquireFile() method, which allows stateless handling of data requests minimizing file opening and closing..

 


This document is maintained by John Caron and was last updated on Sep 15, 2008
 
 
  Contact Us     Site Map     Search     Terms and Conditions     Privacy Policy     Participation Policy
 
National Science Foundation (NSF) UCAR Office of Programs University Corporation for Atmospheric Research (UCAR)   Unidata is a member of the UCAR Office of Programs, is managed by the University Corporation for Atmospheric Research, and is sponsored by the National Science Foundation.
P.O. Box 3000     Boulder, CO 80307-3000 USA     Tel: 303-497-8643     Fax: 303-497-8690