Intel’s Hyper-Threading Technology
The terminology in the technology world can be confusing and easily forgotten, so let me begin by explaining what I mean when I use these terms. A multi-core CPU is a CPU which has more than one core on the same integrated circuit. Multi-chip refers to multiple integrated circuits packaged together. Multi-CPU refers to multiple separate processors within the same system working together. And of course, a CPU is a central processing unit which has one or more cores each having many execution units (which is where the actual math is done.)
So what is hyper-threading? Hyper-threading is a term used by Intel to describe their technology which makes a single CPU core appear to the operating system as two CPU cores. The operating system thus treats the core like it would treat any multi-core by sending it multiple threads simultaneously. While it would be possible to have a hyper-threaded core appear as more than two cores, architectural complexities have limited Intel to only release hyper-threaded cores which appear as two cores.
This isn’t a trick. Intel has designed the architecture of the chip to handle multiple threads in much the same way that a multi-core CPU can. Essentially, what Intel has done is duplicate highly used portions of the CPU core and allowed these sections to be used by separate threads simultaneously. Because these sections of the core separate (they are on the same die, but utilize different parts of that die) the threads do not interfere with each other. These hyper-threading capable cores are not exactly the same as multi-cores; not just any thread can be executed simultaneously with another thread, it has to use a separate part of the core for it’s operations.
Hyper-threading is an example of Simultaneous Multi-Threading (SMT). SMT is one of two types of multi-threading designs. The other type is called Temporal Multi-Threading (TMT). TMT involves a CPU core doing an instruction from one thread, then an instruction from another thread, and then one again from the first thread; this back and forth between threads appears to the user as though two threads are running at the same time, when they are really dividing the CPU time amongst themselves. With SMT instructions from each thread can be executed at the same time. These two designs can of course be combined to maximize performance.
Users should also be aware that not all operating systems support hyper-threading. According to Intel, the following Microsoft operating systems are fully optimized to support hyper-threading technology:
Microsoft Windows XP Professional Edition
Microsoft Windows XP Home Edition
Microsoft Windows Vista Home Basic
Microsoft Windows Vista Home Premium
Microsoft Windows Vista Home Ultimate
Microsoft Windows Vista Home Business
Also according to Intel, the following operating systems are not fully optimized for hyper-threading and hyper-threading support should be disabled in the BIOS setup:
Microsoft Windows 2000 (all versions)
Microsoft Windows NT 4.0
Microsoft Windows ME
Microsoft Windows 98
Microsoft Windows 98 SE
Occasionally certain applications, like FireFox, have issues with hyper-threading. A common trick to alleviate these issues is to run the program in compatibility mode for Windows 98. To do this one needs to right-click the application icon, go to properties, the compatibility, and then check “Run this program in compatibility mode” and choose Windows 98. This will effectively disable hyper-threading for the application as Windows 98 does not support hyper-threading.
Advantages of Hyper-Threading
There are many benefits to hyper-threading. Intel claims that the duplication of certain sections of the CPU core increase the size of the core by about 5 percent while giving a performance boost by as much as 30 percent when compared with an otherwise identical processing core without hyper-threading.
Disadvantages of Hyper-Threading
While hyper-threaded CPU cores do not provide the full advantages of a multi-core CPU they do offer significant advantages over single-core processors. Of course, it’s always good to know what the disadvantages are before utilizing this technology. One disadvantage in many applications is the high power consumption. Since all areas of the core need to be powered on (even in a stand-by state) the overall power consumption of hyper-threading cores, and indeed all SMT capable cores, is higher. Without a high utilization of the speed improvements a hyper-threaded core provides the core would simply use more power. For many applications, including server-farms, and mobile computing, this power consumption is not wanted.
Furthermore, if you compare a hyper-threaded CPU core with a non-hyper-threaded CPU core you will likely see a significant increase in cache thrashing. ARM claims that this increase could be as much as 42%. Comparing this to a multi-core CPU where the cache-thrashing is decreased by 37% and this performance is really brought to light.
Now, after reading these disadvantages you’re probably thinking that hyper-threaded cores are not desirable. And you’re right, in some circumstances. For instance, if power consumption is a main concern for your situation then hyper-threaded cores (or any SMT enabled core) is likely not desirable. However, even if power consumption is high on your list of requirements hyper-threaded cores may be a desirable choice. Consider a server-farm for example. Server farms obviously need to be concerned about their power consumption (those bills can be many thousand dollars per month!). However, in today’s server farms much of the servers are virtualized. So it is quite possible that you have several virtual servers on a single physical server, with each server having only moderate to low performance needs. It is quite conceivable that this type of configuration would provide the right amount of CPU usage to get the maximum performance gains out of a hyper-threaded core while minimizing the power consumption.
As always it is important to carefully consider your operating circumstances before you decide on a technology to use. Rarely is there a technology with no disadvantages. Typically it is only after a careful review of the technology’s advantages and disadvantages while comparing them to your situation can it become clear whether any technology will be beneficial to you. Hyper-threading is just such a technology. For further reading on this subject I’d recommend readind two of my previous articles. Firstly, my article on cache coherency explains how multi-core CPUs access the cache memory. Secondly, my article on processor affinity discusses the interaction between applications and multiple cores. If you have any questions or concerns about this article, feel free to email me and I’ll do my best to respond promptly.