Tech | September 05, 2009 | 7 comments

Snow Leopard's Grand Central Dispatch

Image
lordsbassman
The heart of the matter is that the trick to actually utilizing the full power of multiple processors—or multiple cores within a processor, like the Core 2 Duo you've probably got in your computer if you bought in the last two years—is processing things in parallel. That is, doing lots of stuff side by side. After all, you've got 2, maybe 4 or even 8 processors at your disposal, so to use them as efficiently as possible, you want to pull a problem apart and throw a piece of it at each core, or at least send different problems to different cores. Sounds logical, right? Easy, even.

Snow Leopard's Grand Central Dispatch promises to take a lot of the headache out of parallel programming by managing everything at the OS level, using a system of blocks and queues, so developers don't even have to thread their apps in the traditional way. In the GCD system, a developer tags self-contained units of work as blocks, which are scheduled for execution and placed in a GCD queue. Queues are how GCD manages tasks running parallel and what order they run in, scheduling blocks to run when threads are free to run something.

It's also a bit different from Windows' approach to parallelism, which is app oriented, rather than managing things at the OS level, so it essentially leaves everything up to the apps—apps have got to manage their own threads, make sure they're not eating all of your resources. Which for now, isn't much of a headache, but Reinders says that there is a "valid concern on Windows that a mixture of parallel apps won't cooperate with each other as much," so you could wind up with a situation where say, four apps try to use all 16 cores in your machine, when you'd rather they split up, with say one app using eight cores, another using four, and so on. GCD addresses that problem at the system level, so there's more coordination between apps, which may make it slightly more responsive to the user, if it manages tasks correctly.

Full article @ link
  1. groups:
    Tech,   Current Tonight,   Upstream,   Max and Jason: Still Up
  2. tags:
    Tech Upstream OS Snow Leopard 6 more
  3.     
    |

7 comments // Snow Leopard's Grand Central Dispatch

  • JohnnySoftware
    • 0
      JohnnySoftware  
    • The article was really great. The reporter and the interview subject both did a lot to reach down inside and explain how parallel computing delivers faster performance on today's multicore processors (e.g. Core 2 Duo) in Mac & Windows PCs. Most people do not program apps, they run them. This article did a good job fo explaining the benefits of parallel programming in a way that is useful to both audiences. It is not dumbed down nor is it something that will fly over most people's heads. In that latter regard, when a tough technical word was used - the article hyperlinks it to its entry in Wikipedia. This was an Ace of a technical article. I with authors on other blogs would study it and try to emulate it.

      I was slightly disappointed about one thing, though.

      I practically read the article twice. Chopping out the first half of it and using that here instead of an actual summary was not so helpful. It was like reading half a short story instead of a book reviews. Reading the article had higher value too; since the author had taken the trouble to include hyperlinks to supporting information. It was a gem of an article, though - so I am really grateful someone posted a link to it here on Current.

      I

    • 2 years ago
  • stevieuk
  • Sam_the_Wizer
  • lordsbassman
  • heimbachae
  • kennymotown
  • JonRaymond
more from Tech:

top videos