PDA

View Full Version : single threaded app on a dual?


stephen2002
03-28-2004, 03:54 AM
Something that has been bugging me. I am using WinXP Pro. I know that when I run a single threaded app on my Dual Xeon system it reads as both CPUs holding at about 50% utilization. This dosn't make much sense as the app only has one thread, shouldn't one CPU be spiked at 100% and the other be only 5% or so from servicing other applications? I also know that generally when only using a single-threaded application that is using 100% CPU the temperatures of both processors are about even, but lower than when running a multi-threaded app that puts full load on both. Shouldn't one CPU be higher than the other as one would be crunching away while the other is doing relativly litte?

Does this mean that the single thread jumps back and forth between the CPUs? Wouldn't this degrade preformance and potenially cause stuttering in something like a game as the data is shuffled around? What happens when running two single threaded apps, do they sometimes swap between the CPUs? Wouldn't this cause a lot of cache flushes?

I would appreciate it if somebody would point me in the right direction on this.

GregHess
03-29-2004, 12:19 PM
Stephen,

If your really worried...

Pull up task manager (ctrl-alt-del), go to processes.

Right click on the process you want to modifiy and say "Set Affinity". Set the affinity to either cpu 1 or cpu2. Test the program's responsiveness.

I think you'll find it performs exactly the same as if both processors were on.

The way win2k/xp displays the processor usage is kinda of skewed, and isn't really 100% representative of whats going on.

stephen2002
03-29-2004, 06:17 PM
I did what you suggested and one CPU spiked up to 100% and the other went down to idle, as expected. When I re-enabled both CPUs for the application both of them went to 50%.

I would think it would be a major preformance hit to be swaping around between the CPUs (if that is really what is happening) because of the cache but I guess not. I'll try to benchmark a little bit later.

GregHess
03-29-2004, 07:13 PM
There should be zero difference in performance.

Just consider 50/50 as one of the CPU's being spiked. Do some benchmarks if you want to make sure though.

stephen2002
04-01-2004, 05:08 PM
I did a simple benchmark (WinAce compression speed) and found that there basically is no difference between affiliating with one CPU vs. both of the CPUs.

CGTalk Moderation
01-17-2006, 10:00 PM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.