Skip to content

Concurrent read access

Paal Kvamme requested to merge kvamme62/concurrency into master

The OpenZGY library by design allows reading the same file concurrently from multiple threads.

This pull request fixes some places where the code did not yet allow that. It also adds annotation to many individual classes and methods explaining why they can or cannot be invoked concurrently.

By design the library does not allow concurrent writes from application code.

To make the code more robust the methods in class ZgyWriter are now serialized using a lock. It may still be possible to speed up writes by using multiple threads. But this will need to be done inside OpenZGY itself.

Even though the application is now allowed to write using multiple threads this is discouraged. Because the application then loses some control over how the bricks are ordered on the file.

Note that methods such as finalize() and close() cannot be made thread safe because they application must make sure it is done will all reads and writes before invoking them exactly once.

Merge request reports

Loading