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 8994481
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T23:26:31+00:00 2026-06-15T23:26:31+00:00

Possible Duplicate: What is the difference between dispatch_get_global_queue and dispatch_queue_create? I see some methods

  • 0

Possible Duplicate:
What is the difference between dispatch_get_global_queue and dispatch_queue_create?

I see some methods using gcd,but some of them may do it like this:

dispatch_queue_t queue = dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_HIGH, 0);
dispatch_async(queue, ^{

    dispatch_sync(dispatch_get_main_queue(), ^{

    });
});

but others may do it like this:

imageQueue_ = dispatch_queue_create("com.company.app.imageQueue", NULL);
dispatch_async(imageQueue_, ^{
        dispatch_async(dispatch_get_main_queue(), ^{

        });
    });

What’s the differences?If i want to download many images from web,which is better?

  • 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-06-15T23:26:32+00:00Added an answer on June 15, 2026 at 11:26 pm

    The best way to conceptualize queues is to first realize that at the very low-level, there are only two types of queues: serial and concurrent.

    Serial queues are monogamous, but uncommitted. If you give a bunch of tasks to each serial queue, it will run them one at a time, using only one thread at a time. The uncommitted aspect is that serials queues may switch to a different thread between tasks. Serial queues always wait for a task to finish before going to the next one. Thus tasks are completed in FIFO order. You can make as many serial queues as you need.

    The main queue is a special serial queue. Unlike other serial queues, which are uncommitted, in that they are “dating” many threads but only one at time, the main queue is “married” to the main thread and all tasks are performed on it. The main queue behaves nicely with the main thread’s runloop so that small operations don’t block the UI and other important bits. Like all serial queues, tasks are completed in FIFO order.

    If serial queues are monogamous, concurrent queues are promiscuous. They will submit tasks to any available thread or even make new threads depending on system load. They may perform multiple tasks simultaneously on different threads. It’s important that tasks submitted to the global queue are thread-safe and minimize side-effects. Tasks are submitted for execution in FIFO order, but order of completion is not guaranteed.

    Bringing it back, all global queues are concurrent and all user queues are serial by default, unless define it as concurrent.

    If your goal is to download images, you probably want a serial (user) queue. Downloading images is more of a bandwidth thing. You usually only want to do a one (or a few) at a time.

    edit:blog post expanding on the above answer: http://amattn.com/2013/08/28/grand_central_dispatch_gcd_summary_syntax_best_practices.html

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

Sidebar

Related Questions

Possible Duplicate: Ruby: difference between || and ‘or’ Using Ruby || and or are
Possible Duplicate: Difference between void main and int main? Alright, so I'm using bloodshed
Possible Duplicate: Difference between using var and not using var in JavaScript Hello, I
Possible Duplicate: Difference between “var” and “object” in C# I would like to know
Possible Duplicate: Difference between a Structure and a Union in C I see this
Possible Duplicate: Difference between using var and not using var in JavaScript var foo
Possible Duplicate: Difference between single quotes and double quotes in Javascript Sorry guys, but
Possible Duplicate: Difference between using var and not using var in JavaScript What is
Possible Duplicate: Difference between JOIN and INNER JOIN I have found some legacy SQL
Possible Duplicate: Difference between using var and not using var in JavaScript Hi All

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.