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

ROIGeometry contains methods are not thread safe #164

Open
aaime opened this issue Sep 12, 2017 · 1 comment
Open

ROIGeometry contains methods are not thread safe #164

aaime opened this issue Sep 12, 2017 · 1 comment

Comments

@aaime
Copy link
Member

aaime commented Sep 12, 2017

They are currently using a field to store a point and a rectangle JTS geometries used for containment tests.
This is done to avoid generating a lot of garbage in case the contains methods are called repeatedly (which some operation does), however this makes the class stateful and prone to multithreading problems (with multiple threads all modifying the same point and polygon objects).

This commit fixes the erroenous behavior, but at a high performance price:
aaime@20330e5

Some other approach should probably be used... like a pool of these objects (but we'd need a very lightweight one), thread locals (but how to clean them up?) or... dunno, something else.

@aaime
Copy link
Member Author

aaime commented Sep 12, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants