RE: NSOperationQueue
RE: NSOperationQueue
- Subject: RE: NSOperationQueue
- From: Julius Oklamcak <email@hidden>
- Date: Sat, 02 Jun 2012 00:36:51 -0400
>> 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.
Potentially you could end up queuing up hundreds (or thousands) of thumbnail
generation requests (depending on how many SVG files the user has). If the
user was to close the browser to do something else, or switch to another
app, you would continue generating those thumbnails. My solution, in an iOS
app FWIW, was to cancel the thumbnail generation operations for the
thumbnails that scrolled out of view.
_______________________________________________
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