Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6668893
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T03:05:24+00:00 2026-05-26T03:05:24+00:00

Apple’s Grand Central Dispatch reference says: …if your application needs to operate at the

  • 0

Apple’s Grand Central Dispatch reference says:

“…if your application needs to operate at the Unix level of the
system—for example, if it needs to manipulate file descriptors, Mach
ports, signals, or timers. GCD is not restricted to system-level
applications, but before you use it for higher-level applications, you
should consider whether similar functionality provided in Cocoa (via
NSOperation and block objects) would be easier to use or more
appropriate for your needs.”.

http://developer.apple.com/library/ios/#documentation/Performance/Reference/GCD_libdispatch_Ref/Reference/reference.html

I can’t actually think of situations, for high-level applications, in which the use of GCD is mandatory and NSOperation could/should not be used.

Any thoughts?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T03:05:25+00:00Added an answer on May 26, 2026 at 3:05 am

    The point being made here is the same one that Chris Hanson states in his article “When to use NSOperation vs. GCD“:

    The straightforward answer is a general guideline for all application
    development:

    Always use the highest-level abstraction available to you, and drop
    down to lower-level abstractions when measurement shows that they are
    needed.

    In this particular case, it means that when writing Cocoa
    applications, you should generally be using NSOperation rather than
    using GCD directly. Not because of a difference in efficiency, but
    because NSOperation provides a higher-level abstraction atop the
    mechanisms of GCD.

    In general, I agree with this. NSOperation and NSOperationQueue provide support for dependencies and one or two other things that GCD blocks and queues don’t have, and they abstract away the lower-level details of how the concurrent operations are implemented. If you need that functionality, NSOperation is a very good way to go.

    However, after working with both, I’ve found myself replacing all of my NSOperation-based code with GCD blocks and queues. I’ve done this for two reasons: there is significant overhead when using NSOperation for frequent actions, and I believe my code is cleaner and more descriptive when using GCD blocks.

    The first reason comes from profiling in my applications, where I found that the NSOperation object allocation and deallocation process took a significant amount of CPU resources when dealing with small and frequent actions, like rendering an OpenGL ES frame to the screen. GCD blocks completely eliminated that overhead, leading to significant performance improvements.

    The second reason is more subjective, but I believe that my code is cleaner when using blocks than NSOperations. The quick capture of scope allowed by a block and the inline nature of them make for less code, because you don’t need to create custom NSOperation subclasses or bundle up parameters to be passed into the operation, and more descriptive code in my opinion, because you can place the code to be run in a queue at the point where it is fired off.

    Again, its a matter of preference, but I’ve found myself using GCD more, even in otherwise more abstracted Cocoa applications.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Apple introduced Grand Central Dispatch (a thread pool) in Snow Leopard, but haven't gone
Apple says, that in Cocoa -dealloc will not be called neccessarily when the application
Apple says I can register up to 100 devices to distribute an application. Is
Apple says in the NSFetchedPropertyDescription class reference: Note, however, that unlike a playlist a
Apple has explained in Launching the App Store from an iPhone application how one
Apple HIG says I must include a 512x512 and a 29x29 icons along with
Apple says: removeFromSuperview Unlinks the receiver from its superview and its window, and removes
Apple says: UIModalPresentationFormSheet The width and height of the presented view are smaller than
Apple says that there is a visibleRect method on the mac ( Source ),
Apple says that this is a good idea for saving memory. What would that

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.