Professional Documents
Culture Documents
UC Berkeley CS10 “The Beauty and Joy of Computing” : Concurrency (4) UC Berkeley CS10 “The Beauty and Joy of Computing” : Concurrency (6)
en.wikipedia.org/wiki/Moore's_law
Moore’s Law Moore’s Law and related curves
Predicts: 2X Transistors / chip every 2 years
# of transistors on an
integrated circuit (IC)
Year
Garcia, Fall 2010 Garcia, Fall 2010
UC Berkeley CS10 “The Beauty and Joy of Computing” : Concurrency (7) UC Berkeley CS10 “The Beauty and Joy of Computing” : Concurrency (8)
Moore’s Law and related curves Power Density Prediction circa 2000
10000"
Nuclear Reactor"
100"
Core 2 "
10" 4004"
8086" Hot Plate" P6"
8008" Pentium® proc"
286" 386"
486"
8080" 8085"
1"
1970" 1980" 1990" 2000" 2010"
Year"
Garcia, Fall 2010 Source: S. Borkar (Intel) Garcia, Fall 2010
UC Berkeley CS10 “The Beauty and Joy of Computing” : Concurrency (9) UC Berkeley CS10 “The Beauty and Joy of Computing” : Concurrency (10)
Activity Monitor
(on the lab Macs)
shows how active
your cores are
UC Berkeley CS10 “The Beauty and Joy of Computing” : Concurrency (13) UC Berkeley CS10 “The Beauty and Joy of Computing” : Concurrency (14)
en.wikipedia.org/wiki/Amdahl's_law
Speedup Issues : Amdahl’s Law Speedup Issues : Overhead
• Applications can almost never be completely parallelized; some serial
code remains Even assuming no sequential portion, there’s…
Time
Time to think how to divide the problem up
Parallel portion
Time to hand out small “work units” to workers
Serial portion All workers may not work equally fast
1 2 3 4 5 Some workers may fail
Number of Cores
There may be contention for shared resources
• s is serial fraction of program, P is # of cores (was processors)
Workers could overwriting each others’ answers
• Amdahl’s law:
You may have to wait until the last worker returns to
Speedup(P) = Time(1) / Time(P)
proceed (the slowest / weakest link problem)
≤ 1 / ( s + [ (1-s) / P) ], and as P ∞
There’s time to put the data back together in a way
≤1/s
that looks as if it were done by one
• Even if the parallel portion of your application speeds up perfectly,
your performance may be limited by the sequential portion Garcia, Fall 2010 Garcia, Fall 2010
UC Berkeley CS10 “The Beauty and Joy of Computing” : Concurrency (15) UC Berkeley CS10 “The Beauty and Joy of Computing” : Concurrency (16)
en.wikipedia.org/wiki/Concurrent_computing
Life in a multi-core world… But Concurrent programming is hard!
This “sea change” to multi- What if two people
core parallelism means were calling withdraw
that the computing at the same time?
community has to rethink: E.g., balance=100 and
a) Languages two withdraw 75 each
b) Architectures Can anyone see what
c) Algorithms the problem could be?
d) Data Structures This is a race condition
UC Berkeley CS10 “The Beauty and Joy of Computing” : Concurrency (17) UC Berkeley CS10 “The Beauty and Joy of Computing” : Concurrency (18)
Summary
“Sea change” of
computing because
of inability to cool
CPUs means we’re
now in multi-core
world
This brave new world
offers lots of potential
for innovation by
computing
professionals, but also
challenges
Garcia, Fall 2010