13.07.2015 Views

Intel® 64 and IA-32 Architectures Optimization Reference Manual

Intel® 64 and IA-32 Architectures Optimization Reference Manual

Intel® 64 and IA-32 Architectures Optimization Reference Manual

SHOW MORE
SHOW LESS
  • No tags were found...

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

CHAPTER 8MULTICORE AND HYPER-THREADING TECHNOLOGYThis chapter describes software optimization techniques for multithreaded applicationsrunning in an environment using either multiprocessor (MP) systems or processorswith hardware-based multithreading support. Multiprocessor systems aresystems with two or more sockets, each mated with a physical processor package.Intel <strong>64</strong> <strong>and</strong> <strong>IA</strong>-<strong>32</strong> processors that provide hardware multithreading support includedual-core processors, quad-core processors <strong>and</strong> processors supporting HT Technology1 .Computational throughput in a multithreading environment can increase as morehardware resources are added to take advantage of thread-level or task-level parallelism.Hardware resources can be added in the form of more than one physicalprocessor,processor-core-per-package, <strong>and</strong>/or logical-processor-per-core. Therefore,there are some aspects of multithreading optimization that apply across MP,multicore, <strong>and</strong> HT Technology. There are also some specific microarchitecturalresources that may be implemented differently in different hardware multithreadingconfigurations (for example: execution resources are not shared across differentcores but shared by two logical processors in the same core if HT Technology isenabled). This chapter covers guidelines that apply to these situations.This chapter covers• Performance characteristics <strong>and</strong> usage models• Programming models for multithreaded applications• Software optimization techniques in five specific areas8.1 PERFORMANCE AND USAGE MODELSThe performance gains of using multiple processors, multicore processors or HTTechnology are greatly affected by the usage model <strong>and</strong> the amount of parallelism inthe control flow of the workload. Two common usage models are:• Multithreaded applications• Multitasking using single-threaded applications1. The presence of hardware multithreading support in Intel <strong>64</strong> <strong>and</strong> <strong>IA</strong>-<strong>32</strong> processors can bedetected by checking the feature flag CPUID .01H:EDX[28]. A return value of in bit 28 indicatesthat at least one form of hardware multithreading is present in the physical processor package.The number of logical processors present in each package can also be obtained from CPUID. Theapplication must check how many logical processors are enabled <strong>and</strong> made available to applicationat runtime by making the appropriate operating system calls. See the Intel® <strong>64</strong> <strong>and</strong> <strong>IA</strong>-<strong>32</strong><strong>Architectures</strong> Software Developer’s <strong>Manual</strong>, Volume 2A for information.8-1

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!