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 force-pushed the prep-geom-threadsafe branch from 996f7e2 to f89069e Compare March 1, 2023 00:57
@dbaston dbaston added this to the 3.13.0 milestone Jun 7, 2023
@robe2
Copy link
Member

robe2 commented Aug 21, 2024

@dbaston This says it's slated for 3.13, is that still true, or should we push to 3.14. I've pushed to 3.14, push back if I am mistaken.

@gauteh
Copy link

gauteh commented Sep 4, 2024

Hi, I believe we are seeing this in roaring-landmask (gauteh/roaring-landmask#25) through the rust-bindings (georust/geos#95).

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.

3 participants