I am thinking about concurrent scene graph.
The are several modules in the engine, which needs queries to the scene graph, like Physics, Audio, Render. Moreover, in the future, several threads (tasks) inside of module will need concurrent access to the scene graph.
There several options how to do it:
1) copies of scene graph in every module (used also in OpenSceneGraph engine)- needs more memory, but should hold different types of objects - Physics module will hold only physics objects etc. Still it does not resolve problem with concurrent access in the future
2) concurrent containers in the scene graph - maybe the best solution, but currently I can not find best fit for it. Also looks like it hardware dependent and not robust enought. There is Intel Thread Building Blocks library with concurrent containers, but it’s not perfect and doesn’t support Android and iOS.
3) mutexes to isolate queries. Usage of mutex is not good thing for scalable multi threading, but maybe for some usage patterns it’s ok. In my case it’s SINGLE PRODUCER MULTIPLY CONSUMERS model.
Can anyone suggest robust cross platform concurrent containers (hash_map or vector at least) ?
excellent blog http://www.1024cores.net about concurrency and scalability.
UPD: I was wrong about Intel TBB, it’s cool and powerful library. It’s not clear now for me, how to use it under iOS or Android, but it’s Open Source and ports are available for different platforms.