Re: Operations Beachball
Re: Operations Beachball
- Subject: Re: Operations Beachball
- From: "Gerriet M. Denkmann" <email@hidden>
- Date: Wed, 05 Dec 2012 14:46:37 +0700
On 5 Dec 2012, at 01:29, Jens Alfke <email@hidden> wrote:
>
> On Dec 4, 2012, at 3:48 AM, Gerriet M. Denkmann <email@hidden> wrote:
>
>> My app creates lots of MyOperations (subclass of NSOperation) and puts them into an NSOperationQueue.
>> I would expect that the app thus remains responsive, but sometimes it is not.
I made a test project with this Operation:
@implementation GmdOperationBasis
- (void)main
{
if ( [ self isCancelled ] ) return;
double sum = 8;
for( NSUInteger i = 0; i < 133833333; i++ )
{
if ( [ self isCancelled ] ) return;
double j = (double)i;
sum += sqrt(j);
};
}
@end
When I add less than 8 operations to the queue, all is fine.
When I add 8 or more operations to NSOperationQueue (using NSOperationQueueDefaultMaxConcurrentOperationCount concurrent ops) ,
- then switch to some other app,
- then try to make my app active again, I get a beach-ball.
My app becomes responsive again, when all operations have finished.
processorCount = 8 (as reported by NSProcessInfo).
10.8.2. Xcode 4.5.2.
Kind regards,
Gerriet.
_______________________________________________
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