[Hdf-forum] HDF5 -- multithreading support or not?

Dana Robinson derobins at hdfgroup.org
Mon Aug 29 10:14:05 CDT 2016


Hi Isaac,

Are you calling H5close() from one thread and then expecting the other thread to make HDF5 calls? Because HDF5 calls are unlikely to be successful after you shut the library down :)

Normally, you don't need to call H5close() explicitly, btw. It will be called when the program exits.

From the reference manual (https://www.hdfgroup.org/HDF5/doc/RM/RM_H5.html#Library-Close ):

"This function is generally called when the application calls exit(), but may be called earlier in the event of an emergency shutdown or out of a desire to free all resources used by the HDF5 library."

Dana Robinson
Software Engineer
The HDF Group

From: Hdf-forum [mailto:hdf-forum-bounces at lists.hdfgroup.org] On Behalf Of Isaac Gerg
Sent: Friday, August 26, 2016 6:31 PM
To: hdf-forum at lists.hdfgroup.org
Subject: [Hdf-forum] HDF5 -- multithreading support or not?

Hi Folks,

I am a need for a windows application to have two threads read the same hdf5 file as read-only.  I have searched over months on the internet trying to determine if HDF5 can surely handle this case and have found conflicting results.

I have built a test in C++, using the hdf5 C API, to determine if the read is possible.  The test occasional segfaults on H5Close().  I am trying to determine if the segfault is due to HDF5 or my own error.

TL;DR - can HDF5 on windows support having 2 threads read from the same file as online documentation seems to be inconsistent.

Thanks in advance,
Isaac
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.hdfgroup.org/pipermail/hdf-forum_lists.hdfgroup.org/attachments/20160829/68b74889/attachment-0001.html>


More information about the Hdf-forum mailing list