Parallel Programming Survey

CS 441 Lecture, Dr. Lawlor

Pop quiz--so parallel computing is finally going mainstream.  What will this event be most like?
  1. The new 2006 Democratic majority in the US Congress. (New names, lots of hype, but zero measureable effect.)
  2. The worst 1950's rumors about communist spies infiltrating honest American institutions.  (Reliable components slowly going bad without anybody knowing... until it's too late!)
  3. The worst rumors about global warming coming true.  (Plagues of locusts, drought, heat, and major lifestyle changes for everybody.)
  4. A meteorite similar to that which drove the dinosaurs extinct.  (Slow suffocating starvation for 90%+ of earth's life.)
  5. The second coming.  (Dead shall rise, seas shall boil, skies shall burn, seven seals/seven bowls, battle of Armageddon, new Jerusalem on a new Earth.)
Answer: all of the above!
  1. Whatever happens, there's still going to be C++-lookin' code, if for no other reason than the huge quantity of the C++ that's out there already!  The names may change, and the way the code is called may change a lot, but deep down tons of sequential "variable=value;" code will not change.  It's the code that calls your deep-down application code that's likely to change a lot.
  2. Multiple things happening at once means you have to worry about "race conditions", where two (or more) pieces of code "race" to see which one finishes first.  You have to worry about three (nondeterministic!) possibilities: A finishes first, B finishes first, or a tie.  Maybe two of these cases are really rare.  But either one might cause your code to blow up!  (Crash, fail, silently give the wrong answer to a crucial query...)
  3. Parallel programming is a new lifestyle.  You've got to worry about things you didn't have to worry about before.  Concurrency makes some formerly-moral stuff (like static variables) immoral, and can make some formerly immoral stuff (like public members) moral, because the situation has changed.
  4. Many perfectly innocent serial programs will slowly wither and die, because they don't take advantage of parallelism.  They will have the embarrasingly limited, dated feeling of command-line DOS applications (8 character limit),FAT32 partitions (4GB file limit), or software-rendered 3D games (ugly and slow).  Few users will mourn their passing.
  5. Parallel programming really has the potential to change everything.  Just the hardware ranges from staid stuff like SSE to multicore to distributed to GPU to FPGA.  FPGA's don't even run C++ code, dangit.  It's the end of the world!  (As we know it... and I feel fine.)

To get into the proper revolutionary mindset, read:

The Free Lunch is Over: A Fundamental Turn Toward Concurrency in Software
   written by Herb Sutter, smart Microsoft guy on the C++ standards committe

Notable quotes: