geos
geos copied to clipboard
Make prepared geometry (more?) thread-safe
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::getEnvelopeno longer takes anexpansionDistanceargument. That distance is now provided toMonotoneChainBuilder, and the envelopes are eagerly constructed. The previous handling of this parameter was arguably incorrect, in any case.MCIndexSegmentSetMutualIntersector::processcan now accept aSegmentIntersectorargument so that multiple threads can callprocesswith their ownSegmentIntersector. I did not change the entireSegmentSetMutualIntersectorinterface, just this one class.FastSegmentSetIntersectorno longer shares aLineIntersectorbetween calls.IndexedPointInAreaLocatoreagerly 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 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.
Hi, I believe we are seeing this in roaring-landmask (https://github.com/gauteh/roaring-landmask/issues/25) through the rust-bindings (https://github.com/georust/geos/issues/95).