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

PreparedGeometry::contains is not thread safe #95

Open
gauteh opened this issue Sep 8, 2021 · 11 comments
Open

PreparedGeometry::contains is not thread safe #95

gauteh opened this issue Sep 8, 2021 · 11 comments

Comments

@gauteh
Copy link
Contributor

gauteh commented Sep 8, 2021

Hi,

It seems that prepared geometry contains is not thread safe before run at least once. Easiest to provoke on large geometries. Not able to provoke on example in docs.

Regards, Gaute

@GuillaumeGomez
Copy link
Member

Can you provide me a code having this issue so I can fix it and enforce it through tests please?

@gauteh
Copy link
Contributor Author

gauteh commented Sep 8, 2021

@GuillaumeGomez
Copy link
Member

Ok, I'll try to take a look when I have a bit of time.

@gauteh
Copy link
Contributor Author

gauteh commented Sep 8, 2021

👍 thanks. I can work around this atm by using a warmup call. It is most likely an upstream bug. But would be a pity to !Send/!Sync Geometry/PreparedGeometry just because of that.

@GuillaumeGomez
Copy link
Member

Don't hesitate to take a look in the meantime. If yu can find a way to go around this limitation without removing Send and Sync, it'd be perfect. :)

@gauteh
Copy link
Contributor Author

gauteh commented Sep 8, 2021 via email

@GuillaumeGomez
Copy link
Member

Thanks, greatly appreciated! A bit under the water currently. ^^'

@gauteh
Copy link
Contributor Author

gauteh commented Sep 8, 2021

No problem, thanks for the effort!

@gauteh
Copy link
Contributor Author

gauteh commented May 14, 2024

In version 9 with geos 3.11 it is no longer reliable to warm up the prepared geometry to make it thread safe.

@gauteh
Copy link
Contributor Author

gauteh commented Aug 29, 2024

This is still the case, I don't know how to fix this. PreparedGeometry is not thread-safe.

This test fails: https://github.com/gauteh/roaring-landmask/blob/main/src/lib.rs#L328
While this is ok: https://github.com/gauteh/roaring-landmask/blob/main/src/lib.rs#L283

In https://github.com/gauteh/roaring-landmask/blob/geos311/src/shapes.rs the unsafe is removed, and the test is still failing.

@gauteh gauteh changed the title PreparedGeometry::contains is not thread safe before run at least once PreparedGeometry::contains is not thread safe Aug 31, 2024
@gauteh
Copy link
Contributor Author

gauteh commented Sep 4, 2024

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

No branches or pull requests

2 participants