I would like to run my logic on a different thread then the rendering.
The problem: The logic thread moves the units around, generally changing their state, while the render thread tries to render them.
The most naive approach is to use a bunch of locks on the different entities. But as far as I know locks are performance eaters. Although I know that since hyper-threading that overhead has gone down significantly.
Another option is to copy the state on every render frame before I render it. But that also looks very expensive performance-wise.
I could also lock the renderer while the logic is running, but then what's the point of being multi-threaded?
So I'd like to know:
What is the correct approach to concurrent rendering while running game-logic?
Edited by SillyCow, 28 October 2012 - 05:47 PM.