HEXRD / hexrd

A cross-platform, open-source library for the analysis of X-ray diffraction data.
Other
55 stars 26 forks source link

Make __getitem__ for raw imageseries threadsafe #611

Closed psavery closed 7 months ago

psavery commented 7 months ago

This ensures that for multithreaded situations (such as writing out a frame cache), __getitem__ will be thread-safe. The change ensures that the frame will be obtained immediately after seeking, and no other thread can seek until the frame is obtained.

When I test the example Darren gave us (#608) on the master branch with no multithreading, it ran in 5m 37s. With this change, and using multithreading, it ran in 5m 13s. So the multithreading produced a minor speed increase.

Fixes: #608

psavery commented 7 months ago

@donald-e-boyce Can you look over this? Feel free to run some of your tests to see if you notice a performance impact caused by the thread locking.