Executing a very low-priority operation in iOS
Executing a very low-priority operation in iOS
- Subject: Executing a very low-priority operation in iOS
- From: Rick Mann <email@hidden>
- Date: Wed, 25 Apr 2012 17:32:10 -0700
We have an app whose main function (on the main runloop) operates on a timer at about 30 Hz (eventually triggering a display update).
We want to run a separate period function on the order of once a minute. The operation itself is lengthy, and I want it to not impact the main function of the app. I want it to run on a thread of lower priority, so that it is interrupted every time our timer fires, and that our main runloop is never preempted in favor of the lower-priority task.
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.
Do I need to create my own NSThread for this? Can I get at the thread of an NSOperationQueue and adjust its priority? I didn't think an NSOperationQueue was guaranteed to always run on the same thread.
Thanks,
--
Rick
_______________________________________________
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