Programming with Hyper-Threading Technology: How to Write Multithreaded Software for Intel IA-32 Processors

Chapter 7: Performance

Overview

At the risk of repetition, the primary reason for using parallel programming techniques is to improve performance, although performance is not the only reason to accept the greater effort and complexity imposed by threading and multiprocessing. For example, using threads to express a natural division of labor, as in functional decomposition, is a compelling way to simplify design. But, performance is the principal motivation for using threads. Considerable value derives from designing and implementing programs in the most efficient way possible. A curious aspect of multithreaded programs is that small errors in implementation can have devastating effects on performance, much more so than in single-threaded programs. Because the sources of such errors are well known, the number of things to look for is not great. However, finding them can be extremely subtle and require considerable attention to detail.

This chapter examines the factors that affect parallel performance and how to design and implement programs with them in mind. Topics such as issues with synchronization, discussed in at length in Chapters 2 and 3 are not repeated. By now you are familiar with those topics. The secret to multithreaded performance is to start with good, well-written code; thread it intelligently; and implement it with care to avoid known problems. At every stage in the process, design and implementation decisions should be validated with thorough testing and benchmarking. Chapter 4 provides the code for timing routines for Windows. If you're using Windows, exploit these routines to time your code accurately.

Starting...

UNLIMITED FREE
ACCESS
TO THE WORLD'S BEST IDEAS

SUBMIT
Already a GlobalSpec user? Log in.

This is embarrasing...

An error occurred while processing the form. Please try again in a few minutes.

Customize Your GlobalSpec Experience

Category: Robot Software
Finish!
Privacy Policy

This is embarrasing...

An error occurred while processing the form. Please try again in a few minutes.