Channels ▼

Jonathan Erickson

Dr. Dobb's Bloggers

So How Are We Doin', One Programmer Asks Another

March 11, 2009

"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.

Related Reading


More Insights






Currently we allow the following HTML tags in comments:

Single tags

These tags can be used alone and don't need an ending tag.

<br> Defines a single line break

<hr> Defines a horizontal line

Matching tags

These require an ending tag - e.g. <i>italic text</i>

<a> Defines an anchor

<b> Defines bold text

<big> Defines big text

<blockquote> Defines a long quotation

<caption> Defines a table caption

<cite> Defines a citation

<code> Defines computer code text

<em> Defines emphasized text

<fieldset> Defines a border around elements in a form

<h1> This is heading 1

<h2> This is heading 2

<h3> This is heading 3

<h4> This is heading 4

<h5> This is heading 5

<h6> This is heading 6

<i> Defines italic text

<p> Defines a paragraph

<pre> Defines preformatted text

<q> Defines a short quotation

<samp> Defines sample computer code text

<small> Defines small text

<span> Defines a section in a document

<s> Defines strikethrough text

<strike> Defines strikethrough text

<strong> Defines strong text

<sub> Defines subscripted text

<sup> Defines superscripted text

<u> Defines underlined text

Dr. Dobb's encourages readers to engage in spirited, healthy debate, including taking us to task. However, Dr. Dobb's moderates all comments posted to our site, and reserves the right to modify or remove any content that it determines to be derogatory, offensive, inflammatory, vulgar, irrelevant/off-topic, racist or obvious marketing or spam. Dr. Dobb's further reserves the right to disable the profile of any commenter participating in said activities.

 
Disqus Tips To upload an avatar photo, first complete your Disqus profile. | View the list of supported HTML tags you can use to style comments. | Please read our commenting policy.
 


Video