1

If I have a single 2.6GHz core for example would it mean that with hyperthreading I have only 1.3GHz for a single thread that my app have or is it on demand only if I will use (lets say my app is the only thing that runs on the computer... for the sake of the case no os runs)

single thread single core no HT: thread runs on 2.6GHz single thread single core with HT: thread runs on 1.3GHz?

if its not half the speed assuming I have only a single thread running how much degradation is it with HT on? 10%? else?

Jas
  • 688

2 Answers2

3

No, clock speeds just don't work that way. The execution units in the core run at the same speed regardless of which thread they're operating on behalf of or whether the physical core has HT enabled or disabled.

1

No, it does not mean that. Every task can run on a single thread at full core speed. When one of these gets blocked (e.g. while waiting for relative slow IO from the main memory) another thread can run at the full core speed.

Note that with a single core, dual thread setup you can only use some of the resources in one thread at the same time. E.g. if you have two threads wanting to run and both need to read data from main memory then only one thread can do that. The other will have to wait. If you have two threads and one is doing something purely on-die (e.g. using the ALU) while the other is reading from main memory then both can run at the same time.

Think of it as having a shop with two employees but only one cash register. If both need to access the cash register then one will have to wait (do nothing). Or with luck only one needs to access the cash register and the other is busy talking to the next customer while the first person operates the register. (Thus doing two things simultaneously).

if it is not half the speed assuming I have only a single thread running how much degradation is it with HT on? 10%? else?

It depends on per program. The worst live case I heard is a 30% total slowdown*2 (as in actually slower with HT turned on). The best theoretical case is nearly a 100% gain. In practice, it seems to average about 30% speed gain over using no HT.


*2: The 30% slowdown was in actual production code of a web spider. But worse things are possible. E.g. a database only allowed two threads on a 2 core, 4 thread CPU and a scheduler who schedules both threads persistently on the same physical core.

10-09-2014: Added two links with relevant information:
Wikipedia's: Hyper-threading
Wikipedia: Simultaneous multithreading

Srivishnu
  • 103
Hennes
  • 65,804
  • 7
  • 115
  • 169