Skip to content
This repository has been archived by the owner on Jul 23, 2021. It is now read-only.

Use archery as a mutable database : var t: RTree #19

Open
jmvanel opened this issue Apr 26, 2016 · 2 comments
Open

Use archery as a mutable database : var t: RTree #19

jmvanel opened this issue Apr 26, 2016 · 2 comments

Comments

@jmvanel
Copy link

jmvanel commented Apr 26, 2016

My use case is following a bunch (several hundreds) of mobile objects every few seconds.
Currently I'm doing this, together with a Map to keep track of object by ID.

private var followedObjets: RTree[PointData] = RTree()
...
this.synchronized {
      followedObjets = followedObjets.remove(oldPoint)
      followedObjets = followedObjets.insert(newPoint)
    }

There is a bottleneck, because only a single thread can modify followedObjets . On the other hand, in this particular case, the occurences of concurrent modification attempts are unfrequent, so this is not a problem. But suppose the tracking is every millisecond ...

To avoid this bottleneck, I though to use STM, "software transactional memory" , cf the corresponding chapter in the book "Learning Concurrent Programming in Scala"
Learn the art of building intricate, modern, scalable concurrent applications using Scala
by Aleksandar Prokopec [1]

So, probably , this is not a real issue for Archery, which aims to be a pure immutable data structure, but any comment is apreciated.

[1] https://www.packtpub.com/application-development/learning-concurrent-programming-scala

@jmvanel
Copy link
Author

jmvanel commented Oct 18, 2016

Hi Unndaai
you probably wanted to share a document with me, but this was not the right URL.

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

No branches or pull requests

2 participants
@jmvanel and others