Windows HyperThreading Question

Hello All
I have a quite general question about Hyper threading in windows and how it effects the speed of a program and ....

My limited understanding is that Hyper threading is a way of simulating a "Dual processor" . It is also for some operations to be performed at the same time ( am I right).

I have a program that was using MMX instructions and on a none hyper threaded PC was runing with CPU usage of about 85% ( alot of data cruching and ...).

However, now on the Hyper threaded PC, I see a CPU usage of 55%-60%.

1) What is causing this ?

2) Are some MMX instruction are being performed in parallel in the hyper threaded CPU and not on the other one ?

Thanks
[725 byte] By [shahin] at [2007-11-20 1:38:53]
# 1 Re: Windows HyperThreading Question
Hello All
I have a quite general question about Hyper threading in windows and how it effects the speed of a program and ....

My limited understanding is that Hyper threading is a way of simulating a "Dual processor" . It is also for some operations to be performed at the same time ( am I right).

I have a program that was using MMX instructions and on a none hyper threaded PC was runing with CPU usage of about 85% ( alot of data cruching and ...).

However, now on the Hyper threaded PC, I see a CPU usage of 55%-60%.

1) What is causing this ?

2) Are some MMX instruction are being performed in parallel in the hyper threaded CPU and not on the other one ?

Thanks

Well HT is a capability of processor to run threads almost parallely, the OS sees that as equivalent of 2 processor on single CPU chip.

http://www.intel.com/technology/hyperthread/

And with the changes in processor Speed & HT technology it is quite possible to get result which you are seeing, not sure if MMX has to do with HT, but it's highly possible that there are MMX enhancement which give better results.
Krishnaa at 2007-11-9 13:59:07 >
# 2 Re: Windows HyperThreading Question
Thank you for the quick Reply

The Application that I am runing has MMX instructions in it and is not Multithreaded !!!

So how is HT helps a single threaded application?
shahin at 2007-11-9 14:00:07 >
# 3 Re: Windows HyperThreading Question
So how is HT helps a single threaded application?
It doesn't. If the application is single-threaded, then HT technology will not make any significant change in the speed of its execution.

The reason why you see a drop in CPU usgae (i.e., from 85% on non-HT machine down to 55-60% on HT machine) is that the HT machine essentially has two CPUs, and for a singly-threaded app that's CPU-bound, one of them fully-utilized while the other is virtually idle. Hence, for a singly-threaded app on an HT machine, you will see CPU usage rates of approximately 1/2=50%

Mike
MikeAThon at 2007-11-9 14:01:08 >
# 4 Re: Windows HyperThreading Question
It doesn't. If the application is single-threaded, then HT technology will not make any significant change in the speed of its execution.

The reason why you see a drop in CPU usgae (i.e., from 85% on non-HT machine down to 55-60% on HT machine) is that the HT machine essentially has two CPUs, and for a singly-threaded app that's CPU-bound, one of them fully-utilized while the other is virtually idle. Hence, for a singly-threaded app on an HT machine, you will see CPU usage rates of approximately 1/2=50%

Mike

ok, That makes more sense, Thank you.

So I guess my follow up question is as follow :

Will a single threaded application be able to push a CPU usage to 85% -90% in HT processor ??!!!

The reason that I am asking that is at 85% on a older computer ( no HT enable) , we were at the Maximum through put that we could get from our software.

Now, the question comes to mind that can we get higher through put from the software since only 50% of CPU is being used ??!!

Or is this 55%-60% is the Max?

( This is again assuming that we do not do Multithreading and application stays single threaded).
shahin at 2007-11-9 14:02:03 >
# 5 Re: Windows HyperThreading Question
ok, That makes more sense, Thank you.

So I guess my follow up question is as follow :

Will a single threaded application be able to push a CPU usage to 85% -90% in HT processor ??!!!
Maybe I don't understand your question fully. As I said earlier, if the application is single-threaded, then HT technology will not make any significant change in the speed of its execution.

The reason that I am asking that is at 85% on a older computer ( no HT enable) , we were at the Maximum through put that we could get from our software.

Now, the question comes to mind that can we get higher through put from the software since only 50% of CPU is being used ??!!

Or is this 55%-60% is the Max?

( This is again assuming that we do not do Multithreading and application stays single threaded).
Again, if the application is single-threaded, then HT technology will not make any significant change in the speed of its execution.

On the other hand, your singly-threaded application, which consumes most of the available power in a 1-CPU processor, will work and play better with other applications on a HT machine. For example, on a non-HT machine, attempts to run other applications simultaneously with your CPU-bound application were probably frustrating experiences; the other applications were probably slow and relatively unresponsive. On a HT machine, those other applications can now be delegated to the idle second CPU, and even if your singly-threaded applications hogs the whole of the first CPU, thos other applications will probably now run just fine.

Mike
MikeAThon at 2007-11-9 14:03:04 >
# 6 Re: Windows HyperThreading Question
Thanks Mike your explanation

I guess i am alittle unclear what I was asking. But I think I got all my answers except one which I try to paint a scenario to make it clearer.

Can we see the following happening:

When we open the Taks Manager , under the performance Tab that shows 2 boxex in HT enabled processor, see one of them being pushed to 90% by a single threaded application , while the other one is still around 2-3% useage.

As far as the other application runing better, you are 100% correct and I do see that.

If you want, I can even call you since I am in california as well.
shahin at 2007-11-9 14:04:13 >