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

  • SEARCH
  • Home
  • 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 7440903
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T10:55:27+00:00 2026-05-29T10:55:27+00:00

I searched a variety of sources but don’t really understand the difference between using

  • 0

I searched a variety of sources but don’t really understand the difference between using NSThreads and GCD. I’m completely new to the OS X platform so I might be completely misinterpreting this.

From what I read online, GCD seems to do the exact same thing as basic threads (POSIX, NSThreads etc.) while adding much more technical jargon (“blocks”). It seems to just overcomplicate the basic thread creation system (create thread, run function).

What exactly is GCD and why would it ever be preferred over traditional threading? When should traditional threads be used rather than GCD? And finally is there a reason for GCD’s strange syntax? (“blocks” instead of simply calling functions).

I am on Mac OS X 10.6.8 Snow Leopard and I am not programming for iOS – I am programming for Macs. I am using Xcode 3.6.8 in Cocoa, creating a GUI application.

  • 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-29T10:55:28+00:00Added an answer on May 29, 2026 at 10:55 am

    Advantages of Dispatch

    The advantages of dispatch are mostly outlined here:

    Migrating Away from Threads

    The idea is that you eliminate work on your part, since the paradigm fits MOST code more easily.

    • It reduces the memory penalty your application pays for storing thread stacks in the application’s memory space.
    • It eliminates the code needed to create and configure your threads.
    • It eliminates the code needed to manage and schedule work on threads.
    • It simplifies the code you have to write.

    Empirically, using GCD-type locking instead of @synchronized is about 80% faster or more, though micro-benchmarks may be deceiving. Read more here, though I think the advice to go async with writes does not apply in many cases, and it’s slower (but it’s asynchronous).

    Advantages of Threads

    Why would you continue to use Threads? From the same document:

    It is important to remember that queues are not a panacea for
    replacing threads. The asynchronous programming model offered by
    queues is appropriate in situations where latency is not an issue.
    Even though queues offer ways to configure the execution priority of
    tasks in the queue, higher execution priorities do not guarantee the
    execution of tasks at specific times. Therefore, threads are still a
    more appropriate choice in cases where you need minimal latency, such
    as in audio and video playback.

    Another place where I haven’t personally found an ideal solution using queues is daemon processes that need to be constantly rescheduled. Not that you cannot reschedule them, but looping within a NSThread method is simpler (I think). Edit: Now I’m convinced that even in this context, GCD-style locking would be faster, and you could also do a loop within a GCD-dispatched operation.

    Blocks in Objective-C?

    Blocks are really horrible in Objective-C due to the awful syntax (though Xcode can sometimes help with autocompletion, at least). If you look at blocks in Ruby (or any other language, pretty much) you’ll see how simple and elegant they are for dispatching operations. I’d say that you’ll get used to the Objective-C syntax, but I really think that you’ll get used to copying from your examples a lot 🙂

    You might find my examples from here to be helpful, or just distracting. Not sure.

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

Sidebar

Related Questions

I searched type convertion table between PostgreSQL and C#, but I couldn't find anything.
Searched, but don't come across a satisfying answer. I know there's no a portable
Searched a lot about this problem but never found a answer, that solved it.
I searched a lot but could not find a way to dump table relations
I searched in Google to find the differences between a case class and a
I searched the registry. I'd expect the settings in HKEY_CURRENT_USER\Software\CodeGear\BDS\7.0 but didn't find anything.
Searched through net, could't find a way to read/write file metadata using C or
Have searched the database but need to specifically sum(of hours flown or days off)in
I searched around a bit, but could not find anything useful. Could someone help
I searched for this a lot, but I couldn't find a solution for this

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.