[ODE] ODE in its own thread

Micheál O'Brien mobrien at europe.com
Fri Jul 18 04:56:02 2003


> I have tried several ways to use ODE, including running it in a separate
> thread and rendering in another thread. While I didn't get any noticable
> performance improvement the main disadvantage I encountered is that is
> virtually impossible to exactly synchronize the timesteps of the physics
> calculations and the frames of the rendering thread, which is an
> absolute necessity if you want smooth movements when running full screen
> with vsync enabled. 

I am using ODE is a separate thread too. I have a compile time 
#define that I can switch between ODE in the same thread as the
renderer and a separate thread. There was only only a very minor
frame rate difference between the two - but then I only have a
single cpu computer.

I have noticed the same problems where the physics thread falls
a few frames behind but it's not too noticeable. I have put
a 0ms sleep in the main render loop and a 5ms sleep in the 
physics loop for when that finishes it's bunch of fixed 
timesteps, and that improved things.

I think that on a dual cpu machine the difference could be 
significant. 

Micheál