What happen if

Dear guys,

The children of Node is ArrayList. What happens if we often detach and attach child while we're update render state of Node? Because ArrayList is not thread safe, it is easy to come out "Array Index Exception" for update render state. Is it right man?

never run into such exception even though my AI is changing the scene graph constantly.

this is not only a single multi threaded problem, i think you can also  run into ArrayOutOfBounds exception, if you simply remove nodes inside a Controllers update method.

there is a similar thread:



i meant its not only a multi threaded problem :slight_smile:

The scene graph is generally not thread safe. You always need to synchronize your access on jME's scenegraph. Additionally not all nested calls are allowed (as Core-Dump already said).