Take the 2-minute tour ×

I am curious to know how multiple async NSURLConnection connections handles internally ? I know they use an internal background thread to run it but lets say if in code i am creating two async NSURLConnection concurrently , does that will create two thread internally to run them in parllel or second connection will wait for first to complete ? In brief please confrim how multiple async NSURLConnection achieve concurrency ?

share|improve this question

3 Answers 3

up vote 0 down vote accepted

I guess it will run in parallel. You can have a look on WWDC Session Video about network programming.

Apple engineer said handling url request one by one is expensive, running them in parallel is much more reasonable. The reason is, for processing a request, actually most of the time is spent on latency, not logic processing in devices and servers. So, handling requests parallel will efficiently reduce time waste for latency.

so I guess they wont do async NSURLConnection one by one because it's contradicting this basic theory.

Besides, I have tried to download images Async using NSURLConnection. I sent out a few request once. like

for ( i = 1 to 4) {
    send request i 

The response is also not in sequence.

share|improve this answer
Thanks a lot for this info. This helps me a lot. –  user1908860 Dec 21 '12 at 23:37

Each async NSURLConnection runs on it's own thread after you start the connection (async NSURLConnection has to be created and started on main thread!) and their delegate and datadelegate methods called on main thread.

share|improve this answer
okie, you mean to say for each NSURLConnection one thread will be created internally ? So, is there any max limit of async NSURLConnection can be created concurrently ? –  user1908860 Dec 21 '12 at 8:04
I don't know that :) –  Fahri Azimov Dec 21 '12 at 8:36

Other option that you can use it as using "NSOperationQueue" and execute request using NSOperations. Please refer http://www.icodeblog.com/2012/10/19/tutorial-asynchronous-http-client-using-nsoperationqueue/ for more detail.


share|improve this answer

Your Answer


