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...

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

MULTICORE AND HYPER-THREADING TECHNOLOGY8.1.1 MultithreadingWhen an application employs multithreading to exploit task-level parallelism in aworkload, the control flow of the multi-threaded software can be divided into twoparts: parallel tasks <strong>and</strong> sequential tasks.Amdahl’s law describes an application’s performance gain as it relates to the degreeof parallelism in the control flow. It is a useful guide for selecting the code modules,functions, or instruction sequences that are most likely to realize the most gains fromtransforming sequential tasks <strong>and</strong> control flows into parallel code to take advantagemultithreading hardware support.Figure 8-1 illustrates how performance gains can be realized for any workloadaccording to Amdahl’s law. The bar in Figure 8-1 represents an individual task unit orthe collective workload of an entire application.In general, the speed-up of running multiple threads on an MP systems with N physicalprocessors, over single-threaded execution, can be expressed as:TsequentialPRelativeResponse= ------------------------------- = ⎛1 – P + --- + O⎞Tparallel ⎝ N ⎠where P is the fraction of workload that can be parallelized, <strong>and</strong> O represents theoverhead of multithreading <strong>and</strong> may vary between different operating systems. Inthis case, performance gain is the inverse of the relative response.Single ThreadTsequential1-P PTparallelMulti-Thread on MP1-PP/2P/2OverheadFigure 8-1. Amdahl’s Law <strong>and</strong> MP Speed-upWhen optimizing application performance in a multithreaded environment, controlflow parallelism is likely to have the largest impact on performance scaling withrespect to the number of physical processors <strong>and</strong> to the number of logical processorsper physical processor.8-2

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

Saved successfully!

Ooh no, something went wrong!