2 ms·
I am certainly not an expert. My high level understanding of hyper-threading comes from having a Pentium 4 with it back in the early 00's [1]. Things may have c
by brudgers 8y ago
I am certainly not an expert. My high level understanding of hyper-threading comes from having a Pentium 4 with it back in the early 00's [1]. Things may have changed since then, so I could be wrong...anyway, a simple model of hyperthreading would be a CPU with two operations: load and execute. Each operation takes one CPU cycle. Hyperthreading is possible when both load and execute can run each and every clock cycle.
Cycle 0: Thread 1 loads
Cycle 1: Thread 1 executes & thread 2 loads
Cycle 2: Thread 1 loads & thread 2 executes
Cycle 3: etc.
The advantage of hyperthreading is that there is little or no context switching overhead. At least relative to traditional hardware threads. With a real CPU there are more steps in the pipeline and each step takes a variable amount of time. Later CPU's take advantage of those available cycles with parallel, speculative and out of order execution...but those are generally abstractions over a single thread.
[1]: https://en.wikipedia.org/wiki/Pentium_4 https://en.wikipedia.org/wiki/Pentium_4