Re: NSOperationQueue
Re: NSOperationQueue
- Subject: Re: NSOperationQueue
- From: Charles Srstka <email@hidden>
- Date: Sat, 02 Jun 2012 12:28:12 -0500
On Jun 2, 2012, at 11:54 AM, Markus Spoettl wrote:
> I'm still not seeing how queuePriority would solve the issue. Say you have a queue with maxConcurrentOperationCount == 1
>
> 1) You add operation (A), it starts executing
>
> 2) You add operation (B), (C), (D), (E), (F), (G), (H) and (I) in that order. All wait
>
> Please explain how you suggest to use queuePriority in order to ensure the waiting operations will execute in the reverse order:
>
> (I), (H), (G), (F), (E), (D), (C), (B).
Thinking about this a little more, if you *do* want to execute your operations in LIFO order, you can do that pretty easily as well using dependencies:
[B addDependency:C];
[C addDependency:D];
.
.
[H addDependency:I];
Each time you add an operation to the queue, make it a dependency of the last operation you added that isn’t running yet — this will ensure LIFO order. I wouldn’t do this for the problem the OP is trying to solve, though.
Charles
_______________________________________________
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