Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make prepared geometry (more?) thread-safe #826

Open
wants to merge 8 commits into
base: main
Choose a base branch
from

Conversation

dbaston
Copy link
Member

@dbaston dbaston commented Feb 16, 2023

This PR makes prepared geometries thread-safe, or at least more thread safe than they used to be. The clang thread sanitizer reports no errors on the included test. valgrind --tool=helgrind reports many, but I'm wondering it isn't correctly understanding the std::call_once construct.

This introduces a few number of inconsistencies with JTS. I think they are pretty minor.

  • MonotoneChain::getEnvelope no longer takes an expansionDistance argument. That distance is now provided to MonotoneChainBuilder, and the envelopes are eagerly constructed. The previous handling of this parameter was arguably incorrect, in any case.
  • MCIndexSegmentSetMutualIntersector::process can now accept a SegmentIntersector argument so that multiple threads can call process with their own SegmentIntersector. I did not change the entire SegmentSetMutualIntersector interface, just this one class.
  • FastSegmentSetIntersector no longer shares a LineIntersector between calls.
  • IndexedPointInAreaLocator eagerly builds its index. This should be OK since the locator itself is (usually?) lazily-constructed.

I haven't yet done performance testing to see if there is a penalty for single-threaded uses.

@dbaston dbaston added this to the 3.13.0 milestone Jun 7, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant