Now that multicore processors are coming to mobile devices, wouldn't it be great to take advantage of all those cores without having to manage threads? This concise book shows you how to use Apple's Grand Central Dispatch (GCD) to simplify programming on multicore iOS devices and Mac OS X. Managing your applicationas resources on more than one core isn't easy, but it's vital. Apps that use only one core in a multicore environment will slow to a crawl. If you know how to program with Cocoa or Cocoa Touch, this guide will get you started with GCD right away, with many examples to help you write high-performing multithreaded apps. Package your code as block objects and invoke them with GCD Understand dispatch queuesathe pools of threads managed by GCD Use different methods for executing UI and non-UI tasks Create a group of tasks that GCD can run all at once Instruct GCD to execute tasks only once or after a delay Discover how to construct your own dispatch queuesHere is the same example code from iOS, written for Mac OS X. You can compile it with and without garbage collection enabled for your project: typedef NSString* ... our object that declares a property (nonatomic, copy) for a block object: #import alt;UIKit/UIKit.hagt; typedef NSString* ... MemoryManagementforBlockObjects | 15.
|Title||:||Concurrent Programming in Mac OS X and IOS|
|Publisher||:||"O'Reilly Media, Inc." - 2011-05-31|