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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T15:12:47+00:00 2026-06-09T15:12:47+00:00

I know about the difference between how each works but i want to know

  • 0

I know about the difference between how each works but i want to know in a performance wise point of view (resources inside the iphone).

Lets say I send an asynch request and wait for the delegate to be called. This won’t lock my execution thread. But what is the difference of doing this against just sending a synch request in another thread with GCD.

Like this:

dispatch_queue_t findPicsQueue;

findPicsQueue = dispatch_queue_create("FindPicsQueue", NULL);


dispatch_async(findPicsQueue, ^{

    NSData *theResponse = [NSURLConnection sendSynchronousRequest:theRequest
                                                        returningResponse:&response
                                                                    error:&error];

    NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse*)response;

    if (error) {
       NSLog(@"Error: %@",error)
    }

    if (httpResponse.statusCode == 200) 
    {
        [self parseXMLFile:theResponse]; // Parses Data and modifies picturesFound

        for (PictureData *tmp in picturesFound) {
            NSLog(@"%@",tmp);
        }          
    }  
}

It wont lock my interface since its not being executed in the main thread, but it will lock this specific thread. And I also think GCD runs queues concurrently.

Thanks in advance. I really want to clarify this question.

  • 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-09T15:12:49+00:00Added an answer on June 9, 2026 at 3:12 pm

    If you use NSURLConnection with sendAsynchronousRequest, then almost all processing takes place on the main thread, in particular, the XML parsing will be done on the main thread. Your code example however uses a different thread for processing.

    This difference is relevant if you have an iPhone or iPad processor with two cores. Then the XML parsing can run in parallel with some UI activity on the main thread (in your example). So it can be completed earlier compared to running everything on the main thread (sendAsynchronousRequest approach).

    For older devices with just one core, only one thread will run at a time and the two approaches should behave almost identical.

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

Sidebar

Related Questions

I know about the ADODB.Stream object . But what I really want is a
I wanted to know about the difference about cloud computing and distributed computing. I
I know about http://www.upcdatabase.com/ , but it's quite incomplete. Where popular mobile apps getting
I know about primitives and objects living on the heap, but how does the
I am new to Objective-C and want to know about inheritance. I am aware
I don't know much about creating Makefiles, but I've been reading the make manual
I don't really know much about the capability of the different OSs. However, I
I know that there are many different questions about this sort of topic on
I know there are dozens of questions on different sites about this issue. I
I know about git diff branch1 branch2 . However, I would like to see

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.