There are several questions in this thread, and many tips saying that DO NOT use sendSynchronousRequest in dispatch_async because it blocks the thread, and the GCD generates many new workflows to serve all synchronous URL requests.
No one has a definitive answer as to what iOS 5, [NSURLConnection sendAsynchronousRequest: queue: completionHandler:] is doing behind the scenes.
One read message says that it can "optimize" and it can "use the execution loop", but, of course, will not create a new thread for each request.
When I pause my debugger when using sendAsynchronousRequest: queue: completeHandler, the stack trace looks like this:

.. it now seems that sendAsynchronousRequest: queue: completHandler actually calls sendSynchronousRequest, and I still have tons of threads created when I use the async method instead of the synchronization method.
Yes, there are other advantages to using an asynchronous call, which I do not want to discuss in this post.
All I'm interested in is using performance / thread / system, and if Iโm worse off using the synchronization call inside dispatch_async instead of using the asynchronous call.
I also don't need advice on using ios4 asynchronous calls, this is purely for educational purposes.
Does anyone have insightful answers to this?
thanks
source share