Re: Spinning the busy indicator
Re: Spinning the busy indicator
- Subject: Re: Spinning the busy indicator
- From: Steve Mills <email@hidden>
- Date: Fri, 01 May 2015 00:13:30 -0500
On May 1, 2015, at 00:08:33, Graham Cox <email@hidden> wrote:
>
> Well, it’s always gratifying to find I’m not alone ;)
>
> How did you figure out a value that leaves one for the main thread? The actual value returned is -1 for NSOperationQueueDefaultMaxConcurrentOperationCount, not the actual number it calculated. I guess there’s a way to get the number of cores, but that isn’t necessarily the whole story…?
I just dinked around until I found something that worked for my app (which can create many more ops than there are cores). I ended up with:
const NSUInteger numCores = [[NSProcessInfo processInfo] processorCount] * 2 - 1;
[self.searchQueue setMaxConcurrentOperationCount:(NSInteger)numCores];
--
Steve Mills
Drummer, Mac geek
_______________________________________________
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