• 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: Executing a very low-priority operation in iOS
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Executing a very low-priority operation in iOS


  • Subject: Re: Executing a very low-priority operation in iOS
  • From: Rick Mann <email@hidden>
  • Date: Wed, 25 Apr 2012 17:58:09 -0700

On Apr 25, 2012, at 17:50 , Julius Oklamcak wrote:

>> Normally I'd set up a timer to fire in a minute, set up an
> NSBlockOperation,
>> and let it go. When it finishes, I'd repeat the process. But I don't see
> any
>> way to adjust the priority of an NSOperationQueue.
>
> NSBlockOperation inherits from NSOperation so you should be able to
> -setQueuePriority: and/or -setThreadPriority: on it.

-setQueuePriority:, I think, only adjusts the priority of that operation relative to other operations on that queue.

But -setThreadPriority: is obvious; I didn't even see it there, despite staring right at it.

Thanks!
--
Rick

>
> You could also use something like the following to run the block:
>
> dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_BACKGROUND,
> 0),
> ^{
> 	// ...
> });
>


_______________________________________________

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: 
 >Executing a very low-priority operation in iOS (From: Rick Mann <email@hidden>)
 >RE: Executing a very low-priority operation in iOS (From: Julius Oklamcak <email@hidden>)

  • Prev by Date: RE: Executing a very low-priority operation in iOS
  • Next by Date: NSOperation thread priority ignored?
  • Previous by thread: RE: Executing a very low-priority operation in iOS
  • Next by thread: NSOperation thread priority ignored?
  • Index(es):
    • Date
    • Thread