[gdal-dev] NetCDF+HDF5 and threadsafety

Even Rouault even.rouault at spatialys.com
Thu Feb 4 15:09:59 PST 2016


Le jeudi 04 février 2016 23:55:57, William Kyngesburye a écrit :
> I'm updating my HDF5 library and ran into a catch-22: I build my HDF5 with
> threadsafety (threadsafe is good, right?), and NetCDF4 requires HDF5 with
> the high-level library.  At HDF5 1.8.12 I could do this combination, but
> HDF5 1.8.16 (I think it started with 1.8.13) says threadsafe and
> high-level options are not compatible.
> 
> Is threadsafety in HDF5 important for GDAL?

Hum, likely if people use the HDF5 driver in a multi-threaded context. GDAL 
has explicit mutex around calls to the netCDF and HDF4 lib in the netCDF and 
HDF4 drivers (since at least the versions of those lib I use are not thread-
safe), but not from the HDF5 driver. So if the HDF5 lib is not re-entrant, 
there might be issues.

There's an optionnaly compiled app you can use to test threadsafety :

cd apps
make multireadtest
./multireadtest -nlo [-oi number_of_iterations] file_to_test

Increase number_of_iterations so that it runs for a few seconds.

Just testing it on my own HDF5 lib (ancient 1.8.4-5 on Ubuntu 10.04), I see 
crashes... Looking at the stacktrace, I see my HDF5 lib has however mutex 
protection, but apparently not sufficiently robust for this stress test.

> 
> -----
> William Kyngesburye <kyngchaos*at*kyngchaos*dot*com>
> http://www.kyngchaos.com/
> 
> "Those people who most want to rule people are, ipso-facto, those least
> suited to do it."
> 
> - A rule of the universe, from the HitchHiker's Guide to the Galaxy
> 
> 
> _______________________________________________
> gdal-dev mailing list
> gdal-dev at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/gdal-dev

-- 
Spatialys - Geospatial professional services
http://www.spatialys.com


More information about the gdal-dev mailing list