Hyper-threading (officially called Hyper-Threading Technology or HT Technology and abbreviated as HTT or HT) is Intel's proprietary simultaneous multithreading (SMT) implementation used to improve parallelization of computations (doing multiple tasks at once) performed on x86 microprocessors. It first appeared in February 2002 on Xeon server processors and in November 2002 on Pentium 4 desktop CPUs. Later, Intel included this technology in Itanium, Atom, and Core 'i' Series CPUs, among others.
For each processor core that is physically present, the operating system addresses two virtual (logical) cores and shares the workload between them when possible. The main function of hyper-threading is to increase the number of independent instructions in the pipeline; it takes advantage of superscalar architecture, in which multiple instructions operate on separate data in parallel. With HTT, one physical core appears as two processors to the operating system, allowing concurrent scheduling of two processes per core. In addition, two or more processes can use the same resources: If resources for one process are not available, then another process can continue if its resources are available.
Hyper-Threading Technology is a form of simultaneous multithreading technology introduced by Intel, while the concept behind the technology has been patented by Sun Microsystems. Architecturally, a processor with Hyper-Threading Technology consists of two logical processors per core, each of which has its own processor architectural state. Each logical processor can be individually halted, interrupted or directed to execute a specified thread, independently from the other logical processor sharing the same physical core.
Unlike a traditional dual-processor configuration that uses two separate physical processors, the logical processors in a hyper-threaded core share the execution resources. These resources include the execution engine, caches, and system bus interface; the sharing of resources allows two logical processors to work with each other more efficiently, and allows a logical processor to borrow resources from a stalled logical core (assuming both logical cores are associated with the same physical core). A processor stalls when it is waiting for data it has sent for so it can finish processing the present thread. The degree of benefit seen when using a hyper-threaded or multi core processor depends on the needs of the software, and how well it and the operating system are written to manage the processor efficiently.
Hyper-threading works by duplicating certain sections of the processor—those that store the architectural state—but not duplicating the main execution resources. This allows a hyper-threading processor to appear as the usual "physical" processor and an extra "logical" processor to the host operating system (HTT-unaware operating systems see two "physical" processors), allowing the operating system to schedule two threads or processes simultaneously and appropriately. When execution resources would not be used by the current task in a processor without hyper-threading, and especially when the processor is stalled, a hyper-threading equipped processor can use those execution resources to execute another scheduled task. (The processor may stall due to a cache miss, branch misprediction, or data dependency.)
This technology is transparent to operating systems and programs. The minimum that is required to take advantage of hyper-threading is symmetric multiprocessing (SMP) support in the operating system, as the logical processors appear as standard separate processors.
It is possible to optimize operating system behavior on multi-processor hyper-threading capable systems. For example, consider an SMP system with two physical processors that are both hyper-threaded (for a total of four logical processors). If the operating system's thread scheduler is unaware of hyper-threading, it will treat all four logical processors the same. If only two threads are eligible to run, it might choose to schedule those threads on the two logical processors that happen to belong to the same physical processor; that processor would become extremely busy while the other would idle, leading to poorer performance than is possible by scheduling the threads onto different physical processors. This problem can be avoided by improving the scheduler to treat logical processors differently from physical processors; in a sense, this is a limited form of the scheduler changes that are required for NUMA systems.
The first published paper describing what is now known as hyper-threading in a general purpose computer was written by Edward S. Davidson and Leonard. E. Shar in 1973.
Denelcor, Inc. introduced multi-threading with the Heterogeneous Element Processor (HEP) in 1982. The HEP pipeline could not hold multiple instructions from the same process. Only one instruction from a given process was allowed to be present in the pipeline at any point in time. Should an instruction from a given process block the pipe, instructions from other processes would continue after the pipeline drained.
US patent for the technology behind hyper-threading was granted to Kenneth Okin at Sun Microsystems in November 1994. At that time, CMOS process technology was not advanced enough to allow for a cost-effective implementation.
Intel implemented hyper-threading on an x86 architecture processor in 2002 with the Foster MP-based Xeon. It was also included on the 3.06 GHz Northwood-based Pentium 4 in the same year, and then remained as a feature in every Pentium 4 HT, Pentium 4 Extreme Edition and Pentium Extreme Edition processor since. The Intel Core & Core 2 processor lines (2006) that succeeded the Pentium 4 model line didn’t utilize hyper-threading. The processors based on the Core microarchitecture did not have hyper-threading because the Core microarchitecture was a descendant of the older P6 microarchitecture. The P6 microarchitecture was used in earlier iterations of Pentium processors, namely, the Pentium Pro, Pentium II and Pentium III (plus their Celeron & Xeon derivatives at the time).
Intel released the Nehalem microarchitecture (Core i7) in November 2008, in which hyper-threading made a return. The first generation Nehalem processors contained four physicals cores and effectively scaled to eight threads. Since then, both two- and six-core models have been released, scaling four and twelve threads respectively. Earlier Intel Atom cores were in-order processors, sometimes with hyper-threading ability, for low power mobile PCs and low-price desktop PCs. The Itanium 9300 launched with eight threads per processor (two threads per core) through enhanced hyper-threading technology. The next model, the Itanium 9500 (Poulson), features a 12-wide issue architecture, with eight CPU cores with support for eight more virtual cores via hyper-threading. The Intel Xeon 5500 server chips also utilize two-way hyper-threading.
According to Intel, the first hyper-threading implementation used only 5% more die area than the comparable non-hyperthreaded processor, but the performance was 15–30% better. Intel claims up to a 30% performance improvement compared with an otherwise identical, non-simultaneous multithreading Pentium 4. Tom's Hardware states: "In some cases a P4 running at 3.0 GHz with HT on can even beat a P4 running at 3.6 GHz with HT turned off." Intel also claims significant performance improvements with a hyper-threading-enabled Pentium 4 processor in some artificial-intelligence algorithms.
Overall the performance history of hyper-threading was a mixed one in the beginning. As one commentary on high-performance computing from November 2002 notes:
Hyper-Threading can improve the performance of some MPI applications, but not all. Depending on the cluster configuration and, most importantly, the nature of the application running on the cluster, performance gains can vary or even be negative. The next step is to use performance tools to understand what areas contribute to performance gains and what areas contribute to performance degradation.
As a result, performance improvements are very application-dependent; however, when running two programs that require full attention of the processor, it can actually seem like one or both of the programs slows down slightly when Hyper-Threading Technology is turned on. This is due to the replay system of the Pentium 4 tying up valuable execution resources, equalizing the processor resources between the two programs, which adds a varying amount of execution time. The Pentium 4 "Prescott" and the Xeon "Nocona" processors received a replay queue that reduces execution time needed for the replay system and completely overcomes the performance penalty.
According to a November 2009 analysis by Intel, performance impacts of hyper-threading result in increased overall latency in case the execution of threads does not result in significant overall throughput gains, which vary by the application. In other words, overall processing latency is significantly increased due to hyper-threading, with the negative effects becoming smaller as there are more simultaneous threads that can effectively use the additional hardware resource utilization provided by hyper-threading. A similar performance analysis is available for the effects of hyper-threading when used to handle tasks related to managing network traffic, such as for processing interrupt requests generated by network interface controllers (NICs). Another paper claims no performance improvements when hyper-threading is used for interrupt handling.
When the first HT processors were released, many operating systems were not optimized for hyper-threading technology (e.g. Windows 2000 and Linux older than 2.4).
In 2006, hyper-threading was criticised for energy inefficiency. For example, specialist low-power CPU design company ARM stated that simultaneous multithreading (SMT) can use up to 46% more power than ordinary dual-core designs. Furthermore, they claimed that SMT increases cache thrashing by 42%, whereas dual core results in a 37% decrease. Intel disputed this claim, stating that hyper-threading is highly efficient because it uses resources that would otherwise be idle or underutilised. In 2010, ARM said it might include simultaneous multithreading in its future chips; however, this was rejected in favor of their 2012 64-bit design.
In 2013, Intel dropped SMT in favor of out-of-order execution for its Silvermont processor cores, as they found this gave better performance with better power efficiency than a lower number of cores with SMT.
In 2017, it was revealed Intel's Skylake and Kaby Lake processors had a bug with their implementation of hyper-threading that could cause data loss. Microcode updates were later released to address the issue.
In 2019, with Coffee Lake, Intel began to move away from including hyper-threading in mainstream Core i7 desktop processors except for highest-end Core i9 parts or Pentium Gold CPUs. It also started recommending disabling hyper-Threading as new CPU vulnerability attacks were revealed which could be mitigated by disabling HT.
In May 2005, Colin Percival demonstrated that a malicious thread on a Pentium 4 can use a timing attack to monitor the memory access patterns of another thread with which it shares a cache, allowing the theft of cryptographic information. Potential solutions to this include the processor changing its cache eviction strategy or the operating system preventing the simultaneous execution, on the same physical core, of threads with different privileges. In 2018 the OpenBSD operating system has disabled hyper-threading "in order to avoid data potentially leaking from applications to other software" caused by the Foreshadow/L1TF vulnerabilities. In 2019 a set of vulnerabilities led to security experts recommending the disabling of hyper-threading on all devices. 
- "Intel Pentium 4 3.06GHz CPU with Hyper-Threading Technology: Killing Two Birds with a Stone..". X-bit labs. Archived from the original on 31 May 2014. https://web.archive.org/web/20140531105602/http://www.xbitlabs.com/articles/cpu/display/pentium4-3066.html. Retrieved 2014-06-04.
- "Intel Processor Spec Finder: SL6WK". http://processorfinder.intel.com/Details.aspx?sSpec=sl6wk.
- Michael E. Thomadakis (2011-03-17). "The Architecture of the Nehalem Processor and Nehalem-EP SMP Platforms". Texas A&M University. p. 23. Archived from the original on 11 August 2014. https://web.archive.org/web/20140811023120/http://sc.tamu.edu/systems/eos/nehalem.pdf. Retrieved 2014-03-21.
- L., Hennessy, John. Computer architecture : a quantitative approach. Patterson, David A.,, Asanović, Krste,, Bakos, Jason D.,, Colwell, Robert P.,, Bhattacharjee, Abhishek, 1984-, Conte, Thomas M., 1964- (Sixth ed.). Cambridge, MA. ISBN 0128119055. OCLC 983459758.
- "A multiminiprocessor system implemented through pipelining", by Leonard Shar and Edward Davidson, IEEE Computer, Feb. 1974, pp. 42-51, vol. 7 https://www.computer.org/csdl/magazine/co/1974/02/4251/13rRUyoyhIt
- Okin, Kenneth (November 1, 1994), United States Patent: 5361337 - Method and apparatus for rapidly switching processes in a computer system, archived from the original on 21 September 2015, https://web.archive.org/web/20150921143211/http://patft.uspto.gov/netacgi/nph-Parser?Sect1=PTO1, retrieved 2016-05-24
- "Page Unavailable". https://www.intel.com/consumer/learn/desktop/corei7-extreme-detail.htm.
- "Intel® Atom™ Processor Microarchitecture". Intel.com. 2011-03-18. http://www.intel.com/technology/atom/microarchitecture.htm. Retrieved 2011-04-05.
- "Intel Discloses New Itanium Poulson Features". Tomshardware.com. http://www.tomshardware.com/news/intel-itanium-poulson-dual-domain-hyper-threading,13279.html. Retrieved 2017-07-02.
- "Server Processor Index Page". Intel.com. 2011-03-18. http://www.intel.com/p/en_US/products/server/processor. Retrieved 2011-04-05.
- "Intel® Xeon® Processor 5500 Series". Intel.com. http://www.intel.com/business/resources/demos/xeon5500/performance/demo.htm. Retrieved 2011-04-05.
- "Wayback Machine". 19 October 2012. http://www.intel.com/technology/itj/2002/volume06issue01/vol6iss1_hyper_threading_technology.pdf.
- 12331095 (28 April 2011). "How to Determine the Effectiveness of Hyper-Threading Technology with an Application". https://software.intel.com/en-us/articles/how-to-determine-the-effectiveness-of-hyper-threading-technology-with-an-application.
- "Summary: In Some Cases The P4 3.0HT Can Even Beat The 3.6 GHz Version : Single CPU in Dual Operation: P4 3.06 GHz with Hyper-Threading Technology". Tomshardware.com. 2002-11-14. http://www.tomshardware.com/reviews/single-cpu-dual-operation,549-25.html. Retrieved 2011-04-05.
- Tau Leng; Rizwan Ali (November 2002). "A Study of Hyper-Threading in High-Performance Computing Clusters". Dell. p. 4. http://ftp.dell.com/app/4q02-Len.pdf. Retrieved 12 November 2012.
- Joel Hruska (24 July 2012). "Maximized performance: Comparing the effects of Hyper-Threading, software updates". http://www.extremetech.com/computing/133121-maximized-performance-comparing-the-effects-of-hyper-threading-software-updates. Retrieved 2 March 2015.
- "CPU Performance Evaluation - Benchmark - Pentium 4 2.8 and 3.0". http://users.telenet.be/nicvroom/performanceP4.htm.
- "Replay: Unknown Features of the NetBurst Core. Page 15". Xbitlabs. Archived from the original on 14 May 2011. https://web.archive.org/web/20110514180659/http://www.xbitlabs.com/articles/cpu/display/replay_15.html#sect0. Retrieved 24 April 2011.
- Antonio Valles (20 November 2009). "Performance Insights to Intel Hyper-Threading Technology". Intel. Archived from the original on 17 February 2015. https://web.archive.org/web/20150217050949/https://software.intel.com/en-us/articles/performance-insights-to-intel-hyper-threading-technology/. Retrieved 26 February 2015.
- "Network Tuning and Performance". 12 November 2013. https://calomel.org/network_performance.html. Retrieved 26 February 2015.
- "Linux kernel documentation: Scaling in the Linux Networking Stack". kernel.org. 1 December 2014. https://www.kernel.org/doc/Documentation/networking/scaling.txt. Retrieved 2 March 2015. "Per-cpu load can be observed using the mpstat utility, but note that on processors with hyperthreading (HT), each hyperthread is represented as a separate CPU. For interrupt handling, HT has shown no benefit in initial tests, so limit the number of queues to the number of CPU cores in the system."
- "Hyper-Threading Technology — Operating systems that include optimizations for Hyper-Threading Technology". Intel.com. 2011-09-19. http://www.intel.com/support/processors/pentium4/sb/cs-017371.htm#1c. Retrieved 2012-02-29.
- Sustainable Practices: Concepts, Methodologies, Tools and Applications. Information Resources Management Association. December 2013. p. 666. ISBN 9781466648524.
- "ARM is no fan of HyperThreading". theinquirer.net. 2006-08-02. http://www.theinquirer.net/inquirer/news/1037948/arm-fan-hyperthreading. Retrieved 2012-02-29.
- Tom Jermoluk, SGI (1990s) (2010-10-13). "About MIPS and MIPS | TOP500 Supercomputing Sites". Top500.org. Archived from the original on 13 June 2011. https://web.archive.org/web/20110613203023/http://www.top500.org/blog/2010/10/13/about_mips_and_mips. Retrieved 2011-04-05.
- "ARM launches first 64bit processor core for servers and smartphones". 30 October 2012. http://www.techdesignforums.com/blog/2012/10/30/arm-64bit-cortex-a53-a57-launch/.
- Rik Myslewski (8 May 2013). "Deep inside Intel's first viable mobile processor: Silvermont". The Register. https://www.theregister.co.uk/2013/05/08/intel_silvermont_microarchitecture/. Retrieved 13 January 2014.
- Chirgwin, Richard (25 June 2017). "Intel's Skylake and Kaby Lake CPUs have nasty hyper-threading bug". The Register. https://www.theregister.co.uk/2017/06/25/intel_skylake_kaby_lake_hyperthreading/.
- "Skylake, Kaby Lake chips have a crash bug with hyperthreading enabled". Ars Technica. 26 June 2017. https://arstechnica.com/information-technology/2017/06/skylake-kaby-lake-chips-have-a-crash-bug-with-hyperthreading-enabled/. Retrieved 25 November 2017.
- Cutress, Ian (23 April 2019). "Intel 9th Gen Core Processors: All the Desktop and Mobile 45W CPUs Announced". AnandTech. https://www.anandtech.com/show/14256/intel-9th-gen-core-processors-all-the-desktop-and-mobile-45w-cpus-announced.
- Armasu, Lucian (14 May 2019). "Intel’s New Spectre-Like Flaw Affects Chips Made Since 2008". Tom's Hardware. https://www.tomshardware.co.uk/intel-disable-hyper-threading-spectre-attack,news-60647.html.
- Colin Percival (2005-05-14). "Cache Missing for Fun and Profit". http://www.daemonology.net/papers/htt.pdf. Retrieved 2016-06-14.
- "OpenBSD disables Intel's hyper-threading over CPU data leak fears" (in en). https://www.theregister.co.uk/2018/06/20/openbsd_disables_intels_hyperthreading/.
- "'Disable SMT/Hyperthreading in all Intel BIOSes' - MARC". https://marc.info/?l=openbsd-tech&m=153504937925732&w=2.
- "Meltdown Redux: Intel Flaw Lets Hackers Siphon Secrets from Millions of PCs". WIRED. 14 May 2019. https://www.wired.com/story/intel-mds-attack-speculative-execution-buffer/. Retrieved 14 May 2019.
- Intel Demonstrates Breakthrough Processor Design, a press release from August 2001
- Intel – high level overview of Hyper-threading
- Hyper-threading on MSDN Magazine
- HyperThreading Overview from OSDEV Community (archived on 27 February 2009)
- introductory article from Ars Technica
- Hyper-Threading Technology Architecture and Microarchitecture, published in Intel Technology Journal Q1, 2002 (archived on 1 November 2012)
- US Patent Number 4,847,755
- Merom, Conroe, Woodcrest lose HyperThreading
- ZDnet: Hyperthreading hurts server performance, say developers
- ARM is no fan of HyperThreading - Outlines problems of SMT solutions
- Replay: Unknown Features of the NetBurst Core
- The Impact of Hyper-Threading on Processor Resource Utilization in Production Applications
Original source: https://en.wikipedia.org/wiki/ Hyper-threading. Read more