[ODE] ODE in its own thread

Nate W coding at natew.com
Thu Jul 17 21:01:02 2003


On Thu, 17 Jul 2003, Frederic Ferland wrote:

> To my surprise, I do not get a performance increase from the
> multi-threading.

Generally speaking, adding threads only speeds things up if one thread is
waiting for an external event (new data from the network, signal from
hardware, etc), or if you have fewer threads than processors.  In other
words, they help ensure that thes CPU is (or "the CPUs are") always busy
doing something.  

In the scenario you describe, the processor is always busy, either
rendering or calculating physics, so it's not spending time idle, so
there's nothing to be gained from doing some of the tasks on a second
thread.  The overhead associated with context switching and
synchronization would probably just slow things down as compared to a
single-threaded approach.

Intel's "hyperthreading" processors might provide a way to get a
performance boost from two thread approach... the hype says it should, but
I don't know how significant the gains are in practice.  Has anyone tried
it?

-- 

Nate Waddoups
Redmond WA USA
http://www.natew.com