Hello gamedev.net. In the past two weeks I have taken time to research data oriented programming and entity component systems. As these two features are seeming to become the norm in engines, I thought that I should learn as much as possible about these two patterns. After reading the GDC 15 article that Bungie released pertaining to their component/data oriented renderer, http://advances.realtimerendering.com/destiny/gdc_2015/Tatarchuk_GDC_2015__Destiny_Renderer_web.pdf,
I seem to have somewhat of a grasp over the rendering side. My problem now relates to updating game objects in a multithreaded environment. I have read that one of the greatest advantages of data oriented/component based engines is cache coherency, in that you can update all, or most, of a certain component at the same time linearly, but I don't understand how that would work in an object system with dependencies such as attachments.
i.e if Object1 is attached to Object2, then Object2 must have all of it's components capable of updating it's internal state (like position/animation possibly physics?) updated prior to Object 1. This would mean that multiple systems would have to be traversed. Would this not make the effort for cache coherency moot?
And in a scenario where Object 2 must be updated prior to Object 1, would Object2 call some type of virtual update function on it's own components based on the update phase that it is in? i.e If Object2 is in a pre physics update phase, would it call all of it's components that are interested in being updated during this phase?
These seem like issues that would make updating a simple entity component, data oriented, and cache coherent system more complex than a basic inheritance based approach in a single threaded environment, let alone a multithreaded one.
To save myself from rambling anymore , I would like to ask for opinions on possible approaches, either proven or theoretical, for updating entities, and their components in a multithreaded environment that tries to sustain cache coherency. I would also like to know if any developers have subscribed to this method and have had success, or if I should go to a simplistic component system and find other ways to optimize my code. Thank you.