What is the best way to do multi threading? I would like to utilize both cores of a common dual code CPU for rendering. I once read, that OpenGL rendering can be done asynchronous. While OpenGL renders you can do other things like frustum culling, physics simulation etc.
I would do it as follows:
1. Create a new Thread (R) for the render context and create the context from within that thread.
2. Create a second thread (C) or use the main application's one for the other work like frustum culling or physics simulation.
3. Suspend thread R (put it to sleep to wait for the notify() method to be called)
4. Prepare the render atoms to be rendered by the context thread within thread C.
5. Check, if Thread R is currently asleep. Wait until it sleeps (finished the last frame). Wake it up.
6. continue with (4.)
Well, this is a very raw description. But you might get, what I mean. Does anybody have experience with it or any good links?
Marvin