A "thread-safe" version of HDF5 is one that can be called from any thread of a multi-threaded program. Any calls to HDF5 can be made in any order, and each individual HDF5 call will perform correctly. Currently, only the first level of thread-safety has been added to HDF5. This version serializes the API suitable for use in a multi-threaded application but does not provide any level of concurrency.
The HDF5 library can be configured to be thread-safe (on a very large scale) by specifying the --enable-threadsafe and --with-pthread=DIR flags when configuring:
./configure --enable-threadsafe --with-pthread=DIR
For information, see:
- FAQ on thread-safety and concurrent access
- Thread Safe HDF5 Library Implementation.
- Paper on Thread Safe HDF-5 Issues, and an Implementation Plan (1999) by Robb Matzke. This paper describes what thread-safety means in regards to HDF5 and discusses issues and an implementation plan. Although it is an old paper (1999) the information in it is still relevant.