[rescue] Dual Processors and applications

Joshua D Boyd jdboyd at cs.millersville.edu
Tue May 7 14:30:15 CDT 2002


On Tue, May 07, 2002 at 12:30:18PM -0500, Brian Dunbar wrote:
> Scenario:
> A dual processor Unix box (sun or hp).  An application (CAD tool) that was
> not specifically optimized for dual processors.  Will the app take advantage
> of the dual processors?
> 
> This is currently a topic of debate on another mail list - but the people
> debating are circuit designers, not computer folk and the thread is laden
> with mis-conceptions and half-truths.  I thought if anyone could give a
> clear answer, it would be this list.

Any program will usually be a little faster on a SMP machine due to having
the OS run on another CPU.  But it is a negligigle improvement.

Otherwise, if the program uses lots of sub processes, it might benefit (like
Apache), but I doubt that is likely to be the case here.  An example of this
would be forking something like sed and communicating with it via pipes.

For instance, program 1:
#include <iostream>

void main() {
  for(int i=0; i<10000000; i++)
    cout << 5.0*i/3.3 << endl;
}

program 2: 
#include <iostream>

void main() {
  float i;
  while (1) {
    cin >> i;
    cout << 3.3*i/5.0 << endl;
  }
}

At the command line
./prog1 | ./prog 2

Doing that maxs both CPUs on my linux system.

-- 
Joshua D. Boyd



More information about the rescue mailing list