Hello, I am using Urho3D recently on a little project.
I encountered some data races problems in the below situations:
-
When different drawables from the same node are putted into different WorkItem that working in different threads.
-
This is kind of rare, when different drawables from different nodes but those nodes have relationships are putted into different WorkItems that working in different threads .
UpdateDrawableGeometriesWork from these different threads may access the same node, sometimes one thread is calling MarkDirty() of that node but another thread is calling UpdateWorldTransform(). When this happens, the precondition in Node::MarkDirty() is broken(MarkDirty() can’t mark all children dirty).
Here is a sample picture showing what this problem causes.
I tried to fix this by arrange the workitems , making all drawables from same node always added to the same workitem. This fixed the first situation but not works in situation 2.
I don’t really want to have a lock or disable the multithread calculation.
I really need some suggestions.!
Thank you.