Re: NSOperationQueue
Re: NSOperationQueue
- Subject: Re: NSOperationQueue
- From: Kyle Sluder <email@hidden>
- Date: Fri, 01 Jun 2012 20:33:04 -0700
On Jun 1, 2012, at 8:23 PM, Graham Cox <email@hidden> wrote:
>
> On 02/06/2012, at 1:12 PM, Kyle Sluder wrote:
>
>> Give them a higher priority. You should be able to alter the priorities as the user scrolls, and NSOperationQueue will do the right thing.
>
>
> I tried this but it doesn't work - a bit of thought about how the ops are queued will show why no meaningful priority value can be assigned.
>
> At the moment that the operations are queued, there are some operations in the queue not yet run, and some running. The code that creates the operations doesn't know which ones are needed more urgently (the latest ones), so it can only assign a high priority to all of them, so they all end up with the same (high) priority and so we're back to square one.
Maintain a mapping of objects to be previewed and the operations that generate those previews. As the user scrolls, figure out which placeholders have been scrolled on/off screen and modify the related operations' priorities appropriately. Altering a running operation's priority won't have an effect.
--Kyle Sluder
_______________________________________________
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