Apple Posts Developer Tutorial on Threading

Apple posted an article at the Apple Developer Connection (ADC) Website on Thursday entitled: "Managing Concurrency with NSOperation." The tutorial explains techniques that allow developers to make better use of multi-core Macs.

"Recent years have seen an end to the continual rise of processor clock speeds, and a move toward multi-core as the way forward. This trend has implications for software developers, because in order to make use of the extra processing power available in multi-core systems, you have to rewrite parts of your application to work concurrently.

"Even if you do not need that extra number-crunching performance in your app, there are many operations such as downloading files that can be more efficient when performed simultaneously," the tutorial explained.

The key is to avoid the lower level threading APIs and use NSOperation and NSOperationQueue classes.

The article explains: "The NSOperation and NSOperationQueue classes alleviate much of the pain of multi-threading, allowing you to simply define your tasks, set any dependencies that exist, and fire them off."

The tutorial has plenty of code examples and should help any developer get that application pumping on all available cores, especially in the Mac Pro which can have up to eight.

Note: the tutorial is located in the public section of the ADC Website and doesnit require an ADC membership to view.