netcdf icon indicating copy to clipboard operation
netcdf copied to clipboard

Regarding thread safety

Open krestomantsi opened this issue 1 year ago • 2 comments

Can someone clarify whether the thread safety corresponds to reading the same file in parallel or multiple reads from different files? Also can the read me please be updated? I did not know how to contact the organisation so I made an issue instead. I apologize if this was wrong.

krestomantsi avatar Jan 09 '24 14:01 krestomantsi

Thread safety is taken care of when using the netcdf crate. You only have to worry about this when using netcdf-sys

magnusuMET avatar Jan 09 '24 14:01 magnusuMET

Note that libnetcdf's approach to threading seems to be "everything takes a global lock" (and I've seen it crash when opening unrelated files on different threads, probably someone forgot to take that lock).

You can use threads with this crate, but don't expect an increase in throughput.

lnicola avatar Jan 09 '24 14:01 lnicola