Was going through these slides before the exam and realized I did not fully understand the difference between software threads, hardware threads and hyperthreads.
From what I understand, software threads are controlled by the OS, that can decide whether or not to swap them out. You can have multiple software threads running on a single core.
Hardware threads appear to the OS as another execution context. One hardware thread can run multiple software threads(only one at a time though).
Hyperthreads is a hardware feature by means of which a hardware thread can pick multiple instructions from different threads to run at the same time. I think they are a way to support instruction level parallelism but I am not sure if this is the same as picking independent instructions and running them at the same time. I think its more along the lines of switching between multiple instructions but I could be wrong. Someone please clarify
MaxFlowMinCut posted a comment on http://15418.courses.cs.cmu.edu/spring2016/lecture/basicarch/slide_048 that helped me understand better.
You have to be careful about what you mean by a "hardware thread" and "hardware thread can pick multiple instructions from different threads to run at the same time".
Typically, an execution context on a core corresponds to a single instruction stream. A hardware thread can be viewed as equivalent to a core. If there are 2 execution contexts, then we have storage for two instruction streams on the processor. This is the notion of hardware multithreading.
Now at each clock, the processor has to pick instruction. If the architecture is superscalar, the processor can pick multiple independent instructions. This is instruction level parallelism.
Now the processor has an additional choice. It can pick 2 instructions from the same instruction stream, or 2 instructions from different instruction streams. These are different notions. I believe the first is called temporal multithreading, and the second is called simultaneous multithreading.
Oh ok I see. So hyper-threading means a form of ILP where you can pick instructions from multiple instruction streams running on the core.
If there was no hyper-threading then one would only be able to execute multiple instructions from the same instruction stream. So even if there were multiple instruction streams running on a core (due to hardware threading) if there was no hyperthreading, one would only be able to pick multiple instructions from one of those instruction streams at a time.