Java Reference
In-Depth Information
processing a different user, but also could be performing different tasks for a user, such as
logging in or adding an item to a shopping cart.
Why Is Parallelism Important?
Historically, we could all rely on the clock frequency of a CPU getting faster over time. In-
tel's 8086 processor, introduced in 1979, started at a 5 MHz clock rate, and by the time the
Pentium chip was introduced in 1993 speeds had reached 60 MHz. Improved sequential per-
formance continued through the early 2000s.
Over the last decade, however, mainstream chip manufacturers have been moving increas-
ingly toward heavily multicore processors. At the time of writing, it's not uncommon for
servers to be shipping with 32 or 64 cores spread over several physical processing units. This
trend shows no sign of abating soon.
This influences the design of software. Instead of being able to rely on improved CPU clock
speeds to increase the computational capacity of existing code, we need to be able to take ad-
vantage of modern CPU architectures. The only way to do this is by writing parallel pro-
grams.
I appreciate you've probably heard this message before. In fact, it's one that's been blasted
out by many conference speakers,and consultants over the years. The implica-
tions of Amdahl's Law were what really made me take note of the importance of parallelism.
Amdahl's Law is a simple rule that predicts the theoretical maximum speedup of a program
on a machine with multiple cores. If we take a program that is entirely serial and parallelize
only half of it, then the maximum speedup possible, regardless of how many cores we throw
at the problem, is 2×. Given a large number of cores—and we're already into that territ-
ory—the execution time of a problem is going to be dominated by the serial part of that
problem.
When you start to think of performance in these terms, optimizing any job that is bound by
computational work rapidly becomes a matter of ensuring that it effectively utilizes the avail-
able hardware. Of course, not every job is bound by computational work, but in this chapter
we'll be focusing on that kind of problem.
Search WWH ::




Custom Search