aldanor / hdf5-rust

HDF5 for Rust
https://docs.rs/hdf5
Apache License 2.0
310 stars 85 forks source link

Lack of documentation on thread safety #255

Closed OWissett closed 1 year ago

OWissett commented 1 year ago

Can someone point me towards the docs which explain/give examples of how to use HDF5-rust with multithreading?

OWissett commented 1 year ago

Since the README states that it should be threadsafe, however, I am getting an issue with open the same file in two threads. I am guessing it might not be safe in the sense that it can open the same file twice?

mulimoen commented 1 year ago

The library is thread-safe in that it all calls are serialized since hdf5 is not thread-safe. So reading from two threads will not work in parallel. What kind of error do you see on opening the same file twice?

OWissett commented 1 year ago

I probably misunderstood, I was trying to open the same file at once in two threads.

mulimoen commented 1 year ago

The library should support it, so if you get weird errors it would be great to have a look and get to the bottom of it