Re: NSURLConnection vs. NSThread
Re: NSURLConnection vs. NSThread
- Subject: Re: NSURLConnection vs. NSThread
- From: Alastair Houghton <email@hidden>
- Date: Thu, 14 May 2009 23:48:17 +0100
On 14 May 2009, at 23:39, Luke the Hiesterman wrote:
Why is it assumed that threads created by NSURLConnection are faster
than threads created manually with NSThread?
It isn't.
Mike's point is that the chances of someone who is asking whether or
not to use NSThread on a developer mailing list doing a better job of
using NSThread than whoever at Apple (or NeXT) wrote NSURLConnection
are slim.
Moreover, NSURLConnection's implementation (threading model, for
instance) may change over time to better fit with developments to the
operating system. I can imagine some changes that might be coming in
a future release of OS X, for instance, as I am sure can many others.
Your own NSThread won't benefit from those changes unless you rewrite
it.
In any event, I would always prefer a pre-existing asynchronous API to
effectively rolling my own (which is what you'd have to do anyway if
you were using your own thread). Even if it isn't going to run any
faster, it's going to be a damn sight faster to implement than rolling
your own, and it's likely to have fewer bugs to boot.
Kind regards,
Alastair.
--
http://alastairs-place.net
_______________________________________________
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