Concurrent Programming in Mac OS X and iOS
Unleash Multicore Performance with Grand Central Dispatch
Publisher: O'Reilly Media
Released: May 2011
Pages: 60

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
Table of Contents
Product Details
About the Author
Recommended for You
Customer Reviews

REVIEW SNAPSHOT®

by PowerReviews
O'Reilly MediaConcurrent Programming in Mac OS X and iOS
 
2.8

(based on 4 reviews)

Ratings Distribution

  • 5 Stars

     

    (1)

  • 4 Stars

     

    (1)

  • 3 Stars

     

    (0)

  • 2 Stars

     

    (0)

  • 1 Stars

     

    (2)

50%

of respondents would recommend this to a friend.

Pros

    Cons

      Best Uses

      • Intermediate (3)
      • Novice (3)
        • Reviewer Profile:
        • Developer (3)

      Reviewed by 4 customers

      Sort by

      Displaying reviews 1-4

      Back to top

      (1 of 1 customers found this review helpful)

       
      1.0

      A really bad book

      By Mike K.

      from Vienna

      About Me Designer, Developer

      Verified Reviewer

      Pros

      • Easy to understand
      • Helpful examples

      Cons

      • Not comprehensive enough
      • Too basic
      • Too many errors

      Best Uses

      • Nobody
      • Novice

      Comments about O'Reilly Media Concurrent Programming in Mac OS X and iOS:

      This book is pretty much useless. The writing style is so simple you feel the author isn't taking you seriously, I was almost offended.

      The book spends to much time talking about things that you don't ever need. Like the _f versions of the functions. No one, ever should be using function pointers instead of blocks.

      The screenshots have nothing to do with the subject matter and frankly, I don't know how they got there.

      Reading Apple's concurrency guide is infinitely better than this book.

      (3 of 3 customers found this review helpful)

       
      5.0

      Good for beginners and intermediates

      By Allan

      from London, UK

      Verified Reviewer

      Pros

      • Accurate
      • Concise
      • Futuristic

      Cons

      • Needs more topics covered

      Best Uses

      • Expert
      • Intermediate
      • Novice
      • Student

      Comments about O'Reilly Media Concurrent Programming in Mac OS X and iOS:

      Being quite familiar with threads, I bought this book looking for an alternative. Don't get me wrong, I still use threads but I *KNOW* that I shouldn't manage threads manually the more complicated and more cores these mobile devices get.

      Mind you, Safari, Mail, Calendar and other system apps have been rewritten by Apple to take advantage of Grand Central Dispatch so that was really my motivation to learn about GCD. I have to admit, this book is quite tiny, however, the things that are covered in it are very handy and the author has been thorough in explaining the differences between queues and how they use threads in the background without the programmer noticing. I don't know if I can make suggestions but I would like to see some timer examples with GCD. I have stopped using threads all in all after reading this book but I'm still stuck with NSTimer so I would like to know how I can replace that with GCD timers (if there is one, there should be...).

      I would still highly recommend this book to you if you are new to GCD and threads and concurrency in iOS and Mac OS. It is a really handy book to have if you are getting started and want to just get down and dirty with concurrency instead of scratching your head trying to find issues in threads and how they handle concurrency.

      (2 of 5 customers found this review helpful)

       
      1.0

      Better read the official documentation

      By Marco

      from Vienna, Austria

      About Me Developer

      Pros

      • Easy to understand

      Cons

      • Doesn't address pitfalls
      • No real-world use cases
      • Too basic

      Best Uses

      • Intermediate
      • Novice

      Comments about O'Reilly Media Concurrent Programming in Mac OS X and iOS:

      The problem with this book is not that it's very short, although it's blown up in length by duplicating most of the code examples, one time for using blocks and another time for using function pointers. One example for that would have been enough, seriously.
      The problem is that it doesn't add any information, tips, or hints for common pitfalls that occur when using GCD with blocks (e.g. easy-to-introduce retain cycles when using instance variables in blocks).

      When you first read Apple's official documentation on GCD and blocks (which you'll do anyways if you're serious about using these technologies) and then read this book, you're left with a feeling that you didn't learn anything new and instead just wasted your time. Removing those duplicate code examples and adding real-world use patterns would have made for a much better and useful book. I can't help feeling that the author simply tried to paraphrase the basics of the official documentation to get a book out.

      (4 of 4 customers found this review helpful)

       
      4.0

      good introduction to queues- Objective-C

      By Michal Konrad Owsiak

      from Poland

      About Me Designer, Developer

      Verified Reviewer

      Pros

      • Accurate
      • Concise
      • Helpful examples

      Cons

        Best Uses

        • Expert
        • Intermediate

        Comments about O'Reilly Media Concurrent Programming in Mac OS X and iOS:

        This book is really short one. But don't be fooled by it's size. In fact it's very comprehensive. One remark here – regarding title. It might be slightly misleading. Book is related to queue mechanics within Mac OS X and iOS rather than treads. But let's take a look at the content. At the very beginning Vandad leads you through the, so called, Block Objects. They have really awkward syntax, but Vandad does a good job here and explains how to construct them. He uses analogy to C and Objective-C related constructs. He also introduces Grand Central Dispatch (GCD) that is a heart of queues. After basis are laid he goes to the topics related to queues and ways of utilizing them. Here, he presents examples that show how to develop parts of code that will utilize queues. This way, you can easily get in touch with the paradigm. Great advantage is that you can easily download source codes from the book page. They work with the XCode 4 out of the box.

        This book, in my opinion, is addressed to experienced users. You will definitely require Objective-C knowledge, and basics of Mac OS X or iOS programming. However, if you are a beginner, simply write the tittle down and come back for it later, when you are ready to go. Or, maybe, when your application will require task based development.

        Displaying reviews 1-4

        Back to top

         
        Buy 2 Get 1 Free Free Shipping Guarantee
        Buying Options
        Immediate Access - Go Digital what's this?
        Ebook: $12.99
        Formats:  DAISY, ePub, Mobi, PDF
        Print & Ebook: $21.99
        Print: $19.99