thanks to that article i came up with a few ideads/possible approaches for the engine a few friends and me are developing.
I wanted to ask some you guys here that are more experienced with multithreading in games about the solutions you came up with and if my ideas are going in the correct way.
i either want...
1)... my game components to contain a boost::thread as a member to execute their seperated update functions (for basic logic, physics, ai..) by themselfes
my fear is that this might create to much overhead
2)... have a threadpool like classes for ai/rendering/physics..., similar to the activeobjectproxy in paul bridger's example, and each game component adds function pointers to the appropriate threadpool. if possible then even the whole class
(i think i prefer this, if my assumption is correct: that all functions/classes in one threadpool can access each other without locking as they are in the same thread - but please correct me, i think i mix up some stuff)
3)...
i have a tree setup of gamecomponents (classes) that have functions for ai/phyics and more -
maybe i should run the a game loop multiple times for ai, physics, basic logic and others, that all have access to my root gamecomponent, and have alle the loops for physics/ai.. proccessing the belonging gamecomponents function and locking/unlocking the needed members?
i also have another question: if multiple threads access a class to only read variables while no other class is writing to that classes members, is that possible? or can only one thread at the time read?
thanks for your advice in advance