tidwall / rtree

An R-tree implementation for Go
MIT License
315 stars 30 forks source link

Is rbang threadsafe, or planned to be threadsafe? #2

Closed Robert-M-Muench closed 3 years ago

Robert-M-Muench commented 3 years ago

I tried to use https://github.com/Workiva/go-datastructures/tree/master/rtree, but it seems buggy when you are changing some members' coordinates; deleting and inserting doesn't seem to work correctly.

However, it claims that the RTree can be used threadsafe. From looking at the source, I think rbang is not threadsafe. Is that correct? Any plans to make it threadsafe?

tidwall commented 3 years ago

rbang is not threadsafe. You will need to use Mutex.

I typically use a RWMutex and wrap Lock/Unlock around Insert/Delete operations and RLock/RUnlock around the others.

tidwall commented 3 years ago

I have no immediate plans to make it threadsafe.

Robert-M-Muench commented 3 years ago

Ok, thanks.