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

Consider adding a lock to RTree #30

Open
asinghvi17 opened this issue Apr 29, 2024 · 1 comment
Open

Consider adding a lock to RTree #30

asinghvi17 opened this issue Apr 29, 2024 · 1 comment

Comments

@asinghvi17
Copy link
Member

asinghvi17 commented Apr 29, 2024

Libspatialindex is not threadsafe, so all operations (even queries as I understand) need to be done under a lock.

The way you would do this is by adding a lock field to the struct, providing it a ReentrantLock on construction, and then calling the C-API only under a

lock(index.lock)
try
	# call CAPI here
finally
	unlock(index.lock)
end
@rafaqz
Copy link
Member

rafaqz commented Apr 30, 2024

Right even queries use a shared memory pool:
libspatialindex/libspatialindex#189

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