I have a multi-threaded C++ app (using pThreads) that processes a massive flat file that works great on Windows - uses all four cores on my puny CPU. Client wants to run the same code on Red Hat on a fire-breathing 64 Xeon CPU machine. So I compile it here (g++), ran it on Ubuntu on VMWare, and code only used one of the four cores. So I'm thinking that is a VMWare problem, and I send code to client - where it does the same thing (as far as I can tell remotely - mpstat -P ALL shows the CPUs barely loaded). Do I need to do something to force Red Hat to spread out the threads? Is there something I'm missing - I'm trying to get the "nice" priority changed next - but I feel like I'm missing something.
I can post code - but like I said, works great on Windows, uses pThreads, etc.
mpstatshows that all CPUs are "barely loaded", then it seems that your program is not doing anything at all, not even on one CPU. Maybe you have a bottleneck in the I/O code? (Look for high values in the "%iowait" column in mpstat output.) Does the application behavior and the system load change if you increase/decrease the number of threads in your application? – Riccardo Murri Jun 29 '11 at 8:01