Channels ▼

Cameron and Tracey Hughes

Dr. Dobb's Bloggers

Snow Leopard's Grand Central Dispatch and the Gift Horse's Mouth

September 01, 2009

First a disclaimer or at the very least an acknowledgment. We are heavy consumers of Mac technology at Ctest Labs. Our Pantheon cluster boasts several fully loaded multicore Macs. We combine Macs with Sun boxes and Linux boxes in a way that makes for a very formidable cluster-based supercomputer that we call the Pantheon. So right off the bat let me say that we have much love for the Mac.But that being said, we don't know what to make of Snow Leopard's new 'Grand Central Dispatch' (at least not yet). I admit we haven't written any code yet, but already we have some reservations. Once we've RTM our fears may be alleviated but at the moment we're just a wee bit skeptical. In Apple's words:

"Grand Central Dispatch (GCD) is a revolutionary approach to multicore computing. Woven throughout the fabric of Mac OSX version 10.6 Snow Leopard, GCD combines an easy-to-use programming model with highly efficient system services to radically simplify the code needed to make the best use of multiple processors."

In a nutshell here's what Apple says to developers:

"GCD gives developers a simple way to describe the different pieces of work that your applications need to do, and an easy way to describe how those pieces might be dependent upon one another. Units of work are described as blocks in your code while queues are used to organize blocks based on how you believe they need to be executed. By using blocks and queues, you no longer need to worry about threads. ... You can simply let the system manage the work queues and execute the blocks for optimal performance".

GrandCentral_TB_brief_20090608.pdf

Boy... Whew... these white papers sure have a way of making things sound simple.... Ahem....

To the white paper writer's credit I only remember seeing the word 'simple' in the white paper a few times (although it is implied throughout). I always get worried when I see the word simple and parallel programming so easily juxtaposed. This is what me and Tracey are initially concerned about. The software development community just spent the last decade or so moving away from procedural and unit-of-work module decompositions toward object-oriented and agent architectures (we won't mention service oriented architectures here). The basic module is now represented by a noun as opposed to a verb. As a industry we have (for the most part swallowed) the object-oriented paradigm pill. At the design level we now think of software in terms of the objects it consists of and the methods those objects export. It wasn't immediately apparent in the Grand Central Dispatch white paper how the blocks and queue decomposition fits in with object-oriented decomposition but then again as I said at the start we haven't RTM yet so we don't want to jump to conclusions.

We're excited that Apple has offered to solve our multicore programming woes. We're down right appreciative! What a wonderful gift horse it is. But we've come to far with object-oriented and agent-oriented architectures to turn back to a procedural-based framework approach. We hope that this is not the case with GCD. We'll keep you posted.

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