1

This question already has an answer here:

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?

marked as duplicate by Breakthrough, Kevin Panko, Excellll, Moses, Art Gertner Sep 17 '14 at 8:24

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

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

  • I get that you're trying to simplify things, but simplifications that actually include false statements are, IMO, not acceptable. For example, the toll booth analogy implies strongly that either one thread or the other makes forward progress, which is untrue. The two threads use different execution units in the core, so both make progress at the same time. – David Schwartz Sep 9 '14 at 16:25
  • True. I should come up with a better analogy. Thinks Maybe the first person counting money (e.g. using an ALU) while the second person is busy with a second car. Still not great though. Maybe I should either scratch that part or significantly expand it. – Hennes Sep 9 '14 at 16:30
  • Maybe a shop with two employees but only one cash register? – David Schwartz Sep 9 '14 at 16:32
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.

Not the answer you're looking for? Browse other questions tagged or ask your own question.