Skip to content

Is HighFive thread-safe? #614

Answered by 1uc
YoniSp asked this question in Questions
Discussion options

You must be logged in to vote

There's two options:

  • use a thread safe build of HDF5,
  • implement your own API lock.

Personally, since HDF5 is only thread-safe, but without any concurrency, I prefer to implement the locking myself. This way I understand the locking strategy; and the STL supports easy to use mutexes.

You can look into:
https://docs.hdfgroup.org/hdf5/v1_12/_m_t.html

As a side note: when opening there could be a race, if you're opening and truncating the files.

Replies: 3 comments

Comment options

You must be logged in to vote
0 replies
Answer selected by alkino
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants
Converted from issue

This discussion was converted from issue #609 on October 12, 2022 11:46.