Hyperthreading is a bit different from Multithreading. So What is Hyper-threading? To know more about it, go ahead and read your way.
There are three types of CPUs that are commonly used.
- Single-Core CPU
- Multi-Core CPU
Single Core CPU
The first is the Single-Core CPU. If you look at the system like raspberry pi 0 that has a single-core processor on it. Yet it can run a multitasking operating system like Linux, and it appears to be doing multiple things at once. It does multi-threading but it does that by switching very quickly between different programs. Giving each one a slice of time and therefore giving the appearance it’s actually doing multiple things at once. But the fact is, it is doing only one thing at once.
The second type of processor we use is a multi-core system like quad-core, octa-core CPU, etc. All the cores in a multi-core CPU share some common buses, some common caches. In terms of fetching instructions from the memory, decoding them, executing them and writing the results back to the memory, each of those CPU cores is completely independent. The operating system can give tasks to one CPU or to the other CPU or all of them can be used simultaneously during multitasking.
What is Hyper-threading?
The third kind of CPU that is used is one with Hyperthreading, so What is Hyper-threading? Let’s start with the idea of a single-core computer with two threads. So what happens when you have two threads is that some of the front ends of the work the CPU does are duplicated. Normally you have this front end stuff that’s maybe to do with fetching instructions and doing some of the initial decodes, that would actually be at the front of the queue of the pipeline and then as the instruction moves down it then moves into the execution stage.
Now by duplicating the initial stuff at the front end two queues of instructions could start being formed i.e. two lots of decodes, two lots of memory fetching and they can start to progress down the pipeline in parallel but at some point. The two pipelines have to merge and it comes back to being just one physical CPU and, because there are these two front ends they are presented to the operating system as actually two CPUs but actually it is only one with two threads running on it.
For a visual demonstration of the process goto 1:50 segment of the video.
Computing tasks that benefit from hyperthreading and multiple processing cores are video editing, 3-D rendering, and heavy multitasking. Video editing is a great example because one frame of a video can be processed. When the next one is queued up because the video is already shot and the machine does not have to guess what is going to be in the next frame.
Hyperthreading is not as doubling your processing course it is basically a clever trick for more efficient scheduling of the work that is done by the processing course that you have. It also increases power consumption and heats output a little bit but its benefits outweighs them all.
Hyperthreading increases the performance of the CPU by 25%, it is like having one and a quarter core. So if you have four cores and eight threads, it is actually the same as having five actual physical cores (performance-wise).
Read more about Virtual Memory here