HDFGroup / HDF.PInvoke

Raw HDF5 Power for .NET
http://www.hdfgroup.org/HDF5
Other
80 stars 29 forks source link

Thread safety? #180

Closed PhilPJL closed 2 years ago

PhilPJL commented 2 years ago

Is HDF.PInvoke.1.10.612 (.NET Standard version) thread safe? My tests appear to say no.

PhilPJL commented 2 years ago

I see that calling

                uint is_ts = 0;
                H5.is_library_threadsafe(ref is_ts);

Says it's not. Is there a way to enable thread safety?

Shouldn't that method be an out is_ts?

Apollo3zehn commented 2 years ago

It has been built with thread-safety enabled (https://github.com/HDFGroup/HDF.PInvoke.1.10, search for HDF5_ENABLE_THREADSAFE).

See this thread for more information about a possible reason why your library says it is not thread-safe: https://github.com/HDFGroup/HDF.PInvoke/issues/146

PhilPJL commented 2 years ago

Thanks, that has sorted it. Ran a test with multiple threads and created a 4Gb .h5 file. No issues.