Le 28 juil. 09 à 09:07, Debajit Adhikary a écrit :

I have multiple asynchronous HTTP requests being made at the same time. All these use the same NSURLConnection delegate functions. (The receivedData
object is different for each connection though—this is done using a
dictionary with the key as the connection itself. In the delegate, I parse
the receivedDate object, and do additional operations on those parsed
strings)

Everything seems to work fine for me so far, but I'm not sure if I need to
do anything specific to ensure correct “multithreaded” behavior.

- Is it possible that more than two connections will use the delegate at
  the same time? (I would think so)
  - If yes, how is it resolved? (Does Cocoa do this automatically?)
  - Do I need to have additional checks in place to ensure that each
  request is handled “correctly”?

Asynchronous does not mean multithreaded.

Now a simple exercice.
Open the NSURLConnection reference. search for thread.

First answer:

Note that these delegate methods will be called on the thread that started the asynchronous load operation for the associated NSURLConnection object.


_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to