So How Are We Doin', One Programmer Asks Another

"So how are we doing?" James Reinders rhetorically asked a roomful of programmers at SD West 2009 when referring to his Eight Rules for Parallel Programming for Multicore.



  1. Think parallel
  2. Program using abstraction.
  3. Program in tasks, not threads
  4. Design with the option to turn concurrency off
  5. Avoid using locks
  6. Use tools and libraries designed to help with concurrency
  7. Use scalable memory allocators
  8. Design to scale through increased workloads.

And the answer? Pretty good in the center, said Reinders, althought there's work to be done on the edges. The "center", the "edges"? What Reinders was referring to were rules #1 and #8 -- "Think parallel" and "Design to scale", respectively. Thanks in large part to emerging tools like those included in the Intel Parallel Studio toolkit (now in beta), the rules in the middle -- #2 through #7 -- seem to be in hand, to some extent. However, developers still need to starting thinking parallel and designing accordingly.

"It's very important to make sure, if at all possible, your program can run in a single thread with concurrency off," said Reinders. "You shouldn't design your program so it has to have parallelism. It makes it much more difficult to debug."

That said, locks remain a big issue, leading Reinders to revise rule #5 -- "avoid locks". Thanks in part to input from the likes of Herb Sutter, Reinders now thinks that a few locks are okay, and probably better than no locks at all since Parallel Studio tools make it easier to find bottlenecks and identify problematic locks. Reinders followed up on the topic of locks in a standing-room-only BoF gathering later that evening.


Parallel Pattern 5: Stencil
All memory addresses used for reads are expressed as offsets
Distributing Work Across Cores Using .NET
A roll-your-own ThreadPool implementation
Looking For The Lost Packets: Part 2
Looking For The Lost Packets: Part 1

Real World Parallelism Webinar Series
  • February 18, 2010
    Lock Contention, Using Intel Parallel Studio to Improve Performance
    Speaker: Vasanth Tovinkere, Software Engineer, Intel Corporation (Bio)

    Vasanth Tovinkere is a software engineer in the Developer Products Division (DPD) at Intel. His current role involves defining novel approaches to understanding and visualizing parallel performance and consulting with strategic customers to help them prepare and deliver code for the multicore world. Vasanth has been involved in the development of automatic semantic event detectors for digital sports technologies in Intel Labs. He also has been awarded three patents and has two patents pending.

    Abstract:
    Discover how easy it is to use the power of Microsoft Visual Studio and Intel Parallel Studio to find performance issues due to lock contention in threaded applications. This ensures that shipped applications can take better advantage of multicore processors. In this webcast, we provide live demonstrations that show how to identify lock contentions issues with Visual Studio and Intel Parallel Studio, an add-in to Visual Studio that helps developers create fast, reliable code on multicore processors.t.