Original Post
Im trying to implement some multi threading to my game project but have some questions about it. The main threading system will be splitting the update/render thread so the update thread can do some work (non graphics related) while rendering the scene. Done some reading about multithreading but im still confused about few things. the main plan i been testing at is using events in the render threads. so for example the update thread goes like this: - Wait for 'UpdateFrame' signal - update renderable stuff (call rendermanager functions) - trigger 'RenderFrame' signal - update non renderable stuff so the update thread run in a loop waiting for the UpdateFrame signal every time is start the loop process. The UpdateFrame event is triggered at the end of the render proces. This causes both threads to run at same speed and synconise trough events. This seem to work fine for now. All calls to the render manager will add a new 'command' to a command que that is processed by the render thread (all D3D code happens inside the render thread) Now some other theory i been reading about is not syncronise both threads and work with buffers instead so that would change my update thread to: - update renderable stuff (fill a render command que) - trigger 'SwapRenderBuffer' (render thread copy the render command que) - update non renderable stuff in this case both threads will most likely run at different speeds and that kinda bothers me or make me wonder whats the point of it? lets say the render thread runs at 100 FPS but the update thread only run at 1 FPS (its low, but just to set an example). If the update thread can only update the "render command buffer" once a second and the render thread get a new command que every second ... whats the point of drawing the same frame 100 times? so whats the best solution? syncronize threads like in 1ste method or buffer the threads like in second method?