| By Jennifer Moebius | Article Rating: |
|
| September 14, 2009 11:15 AM EDT | Reads: |
454 |
Have you heard of Grand Central Dispatch? If you’re a Mac addict, then you might know that it’s Apple’s new easy-to-use tool for parallelizing code. If you’re not a Mac addict, then the first thing you should know is that GCD is one of the most exciting innovations in software development in years. The second thing is that Apple just released it as a cross-platform open source project, meaning it’s coming soon to a platform near you.
Within the past several years, hardware developers have started expanding the power of computers by adding more CPUs instead of making individual CPUs faster. This approach, called multi-core, comes with both a good and bad side. The good side is that a computer with two CPUs is faster than a computer with one. The bad side is that developing an application that uses two CPUs is pretty hard, meaning most pieces of software will just run on one while leaving the other unused.
For experienced developers, you’re probably thinking “well, that’s what threads are for.” But threads have problems of their own, like knowing how many to allocate. With too few you waste resources by not using the full capability of your system. With too many you waste resources by forcing the excessive threads to compete for valuable CPU time.
Apple created GCD to solve this problem. GCD maintains a pool of threads – no more and no fewer than needed. Meanwhile, an application written with GCD breaks itself into tasks. These tasks are added to a queue where they wait for an available thread. The whole thing is faster, lighter weight, and easier to manage than using threads alone.
So now the downsides. First, using GCD requires “blocks” which are another Apple invented coding methodology. Blocks are non-standard, but they’re implemented within the LLVM project. That means that support for blocks is probably not that far from reality on platforms like Linux and other Unix flavors.
The second problem with GCD is that it doesn’t do the heavy lifting of actually breaking up your application into smaller tasks. For some algorithms, this is a pretty easy thing to do. For some algorithms, however, creating parallel tasks is a real challenge.
The last problem is the one that most impacts software testers: any time you introduce parallelism into code, it creates new opportunities for bugs. Despite Apple making GCD incredibly easy to use, developers will almost cretainly create problems like race conditions and deadlocks.
GCD promises to make using multi-core platforms even easier, but only time will tell if it really proves to be the missing link between raw threads and easy-to-develop parallel code. However, my money is on GCD becoming a must-have tool in the next few years.
Read the original blog entry...
Published September 14, 2009 Reads 454
Copyright © 2009 SYS-CON Media, Inc. — All Rights Reserved.
Syndicated stories and blog feeds, all rights reserved by the author.
More Stories By Jennifer Moebius
Jennifer Moebius, Public Relations Manager at uTest, champions media efforts, analyst relations and speaking/awards programs. A media maven and creative writer, Jennifer’s accomplishments include feature articles in BusinessWeek, Fortune, Dow Jones, The New York Times and Investor’s Business Daily. Prior to uTest, Jennifer was Senior Account Executive at boutique PR firm Emerge Public Relations where she managed PR programs for a variety of tech clients including Burton Group, Information Builders, Action Engine, Tizor Systems, good2gether and Harvard Business Publishing.
- Kindle 2 vs Nook
- Confessions of a Ulitzer Addict
- The Cloud Computing Kettle Heats Right Up
- Are You Comfortable with Where Your Data Sleeps at Night?
- Ulitzer Provides a Powerful Social Journalism Platform
- Ulitzer Live! New Media Power Panel at Santa Clara Convention Center
- Instant Professionalism Online Despite Yourself...with Ulitzer
- Rapid Application Delivery - Going Hybrid
- Rhomobile CEO to Speak at iPhone Developer Summit 2009 West
- Rhomobile to Announce Production Release of RhoHub at 4th Cloud Expo
- Sybase Named “Silver Sponsor” of iPhone Developer Summit
- Top 10 Telecom Predictions for 2010
- Kindle 2 vs Nook
- Confessions of a Ulitzer Addict
- RIM Launches BlackBerry Desktop Manager for Mac Users
- Ulitzer Live! New Media Conference & Expo
- The Cloud Computing Kettle Heats Right Up
- Are You Comfortable with Where Your Data Sleeps at Night?
- Ulitzer Provides a Powerful Social Journalism Platform
- Analyst Firm Launches "ZapThink on Ulitzer"
- Open Source Mobile Cloud Sync and Push Email
- Unisys Provides Mobile Support
- Apple Introduces New iPod nano With Built-in Video Camera
- Ulitzer Live! New Media Power Panel at Santa Clara Convention Center
- Where Are RIA Technologies Headed in 2008?
- Sun Blew its "iPhone" Java Opportunity to AJAX
- The Top 250 Players in the Cloud Computing Ecosystem
- AJAXWorld Conference Adds "iPhone Developer Track"
- iPhone Will Make Mobile AJAX and Web 2.0 Happen
- Why Build Applications for the iPhone and iPod Touch?
- Designing For the "iPhone" Is a Refreshing Experience
- New Column: A Geek's Bookshelf
- Building an iPhone Application with Adobe AIR
- Apple U-Turns on iPhone: Third-Party Developers To Get SDK in 2008
- Vodaphone To Present iPhone Developer Session at AJAXWorld
- Why Is iPhone Better? Here's My Story...







































