Re: async NSOperation and NSOperationQueue
Re: async NSOperation and NSOperationQueue
- Subject: Re: async NSOperation and NSOperationQueue
- From: Jens Alfke <email@hidden>
- Date: Mon, 9 Jun 2008 20:01:44 -0700
On 8 Jun '08, at 5:26 PM, Wayne Shao wrote:
So what exactly I should do in the start() method??
Whatever you need to do to start the operation. It should return ASAP
since it's not being run on a background thread.
If I create a thread,
does the operation queue still enforce maxConcurrentOperationCount
or I need
to worry about that in my implementation?
If you have to start a new thread, you probably just want to use the
default synchronous NSOperation mode. The concurrent mode is for when
your code is asynchronous — for example, you're using NSURLConnection
and kick off the connection in the -start method, and then set
yourself as the delegate and wait for callbacks.
But the answer to your question is yes — the queue will only allow a
fixed number of operations to be running at once, sync or async.
—Jens
Attachment:
smime.p7s
Description: S/MIME cryptographic signature
_______________________________________________
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