Hi,
To remove heavy in destruction objects (which will free large buffers
and etc.) I use method like in DatabasePager - hold object references
and pass they to another thread for destructing.
But there is one case which cause crash.
(root)
|
(some nodes)
(...)
| |
(nodeA) (nodeB)
\ /
\ /
(nodeC)
|
(...)
|
(nodeD)
So we have nodeC with two parents, and in some moment we want to delete
subgraph with nodeA.
We remove from graph parents of nodeA and hold it reference to be
destructed later in another thread.
Another thread decrease reference for parents of nodeA and initialize
destruction, so nodeA have no more references and it want to be deleted,
it inform children about that and request to remove it from parent list.
But in render thread we still render main graph and it traverse nodeC,
but someone like nodeD changed it's matrix, this process require to
dirtyBound, and dirtyBound inform all parents about this and tries to
walk backward for all parents and nodeA too.
So one thread iterate _parent vector, second thread change this vector,
and in result CRASH!
Looks like DatabasePager affects this problem too.
What you can advice in this case?
Mikhail.
_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org