• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: NSURLConnection details
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSURLConnection details


  • Subject: Re: NSURLConnection details
  • From: Jens Alfke <email@hidden>
  • Date: Tue, 12 Feb 2008 18:15:42 -0800


On 12 Feb '08, at 4:34 PM, Miguel Coxo wrote:

Does he create more than one thread? If so how many?

Foundation and CFNetwork create a single background thread for async network I/O.
When something happens, that thread posts a message to the main thread's runloop, which calls your delegate methods.


So as far as you're concerned, everything is happening on a single thread.

Also the method that creates all the NSURLDataReceivers/ NSURLConnections
will be invoked from a NSOperation, will this be a problem?

By default, each NSOperation runs its -main method on a separate thread. That's overkill in your case since the calls the operation makes will be asynchronous anyway, and it'll complicate your code because you may well have to deal with thread-safety. I'd advise overriding -start in your NSOperation subclass to make it the type of operation that doesn't create a thread (read the NSOperation docs for details.)


—Jens_______________________________________________

Cocoa-dev mailing list (email@hidden)

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:
This email sent to email@hidden


  • Follow-Ups:
    • Re: NSURLConnection details
      • From: "Miguel Coxo" <email@hidden>
References: 
 >NSURLConnection details (From: "Miguel Coxo" <email@hidden>)

  • Prev by Date: Re: Intercepting keyDown event from NSComboBox
  • Next by Date: Re: Intercepting keyDown event from NSComboBox
  • Previous by thread: Re: NSURLConnection details
  • Next by thread: Re: NSURLConnection details
  • Index(es):
    • Date
    • Thread