• 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: NSOperationQueue
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


References: 
 >NSOperationQueue (From: Graham Cox <email@hidden>)
 >Re: NSOperationQueue (From: Kyle Sluder <email@hidden>)
 >Re: NSOperationQueue (From: Graham Cox <email@hidden>)
 >Re: NSOperationQueue (From: Charles Srstka <email@hidden>)
 >Re: NSOperationQueue (From: Markus Spoettl <email@hidden>)
 >Re: NSOperationQueue (From: Kyle Sluder <email@hidden>)
 >Re: NSOperationQueue (From: Markus Spoettl <email@hidden>)

  • Prev by Date: Re: NSOperationQueue
  • Next by Date: Re: NSOperationQueue
  • Previous by thread: Re: NSOperationQueue
  • Next by thread: Re: Sandboxing. WTF?
  • Index(es):
    • Date
    • Thread