Concurrent Programming in Mac OS X and iOS: Unleash Multicore Performance with Grand Central Dispatch

This document was uploaded by one of our users. The uploader already confirmed that they had the permission to publish it. If you are author/publisher or own the copyright of this documents, please report to us by using this DMCA report form.

Simply click on the Download Book button.

Yes, Book downloads on Ebookily are 100% Free.

Sometimes the book is free on Amazon As well, so go ahead and hit "Search on Amazon"

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 application’s 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 queues—the 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 queues

Author(s): Vandad Nahavandipoor
Publisher: O'Reilly Media
Year: 2011

Language: English
Pages: 58

Table of Contents......Page 7
Preface......Page 9
Using Code Examples......Page 10
How to Contact Us......Page 11
Acknowledgments......Page 12
Short Introduction to Block Objects......Page 13
Constructing Block Objects and Their Syntax......Page 14
Variables and Their Scope in Block Objects......Page 18
Invoking Block Objects......Page 24
Memory Management for Block Objects......Page 25
Short Introduction to Grand Central Dispatch......Page 31
Different Types of Dispatch Queues......Page 33
Performing UI-Related Tasks......Page 34
Performing Non-UI-Related Tasks Synchronously......Page 39
Performing Non-UI-Related Tasks Asynchronously......Page 41
Performing Tasks After a Delay......Page 47
Performing a Task at Most Once......Page 50
Running a Group of Tasks Together......Page 52
Constructing Your Own Dispatch Queues......Page 55