What happens if you remove the "isCancelled" checks?
How do you create your operation queue?
What is the max concurrent operation count of the queue? If 
NSOperationQueueDefaultMaxConcurrentOperationCount, what happens if you set it 
to (processorCount) instead?
When you take a CPU sample of the process, what are your worker threads mainly 
doing (work, or being stuck)?

Joar

On 4 dec 2012, at 23:46, Gerriet M. Denkmann <gerr...@mdenkmann.de> wrote:

> 
> On 5 Dec 2012, at 01:29, Jens Alfke <j...@mooseyard.com> wrote:
> 
>> 
>> On Dec 4, 2012, at 3:48 AM, Gerriet M. Denkmann <gerr...@mdenkmann.de> 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 (Cocoa-dev@lists.apple.com)
> 
> 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:
> https://lists.apple.com/mailman/options/cocoa-dev/joar%40joar.com
> 
> This email sent to j...@joar.com


_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to