• 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: Operations Beachball
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Operations Beachball


  • Subject: Re: Operations Beachball
  • From: "Gerriet M. Denkmann" <email@hidden>
  • Date: Wed, 05 Dec 2012 16:37:01 +0700

On 5 Dec 2012, at 15:57, Joar Wingfors <email@hidden> wrote:

> What happens if you remove the "isCancelled" checks?

No effect on blocking.


> How do you create your operation queue?

	if ( self.operationQueue == nil )
	{
		self.operationQueue = [ [ NSOperationQueue alloc ] init ];

		#ifdef OBSERVE_OPERATION_COUNT	<-- has no effect on blocking
		[ self.operationQueue 	addObserver:	self
								forKeyPath: 	kOperationCount
								options: 		0
								context: 		(__bridge void *)kOperationCount
		];
		#endif
	}
	else
	{
		[ self.operationQueue cancelAllOperations ];
	};

> What is the max concurrent operation count of the queue? If NSOperationQueueDefaultMaxConcurrentOperationCount, what happens if you set it to (processorCount) instead?

With (processorCount) it does no longer block. Very strange. This I did not expect at all.
With NSOperationQueueDefaultMaxConcurrentOperationCount the app gets blocked with more than 8 operations.


> When you take a CPU sample of the process, what are your worker threads mainly doing (work, or being stuck)?

All seem to be in in their main method busy adding square-roots.

>>
>>
>> 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.


_______________________________________________

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: 
 >Operations Beachball (From: "Gerriet M. Denkmann" <email@hidden>)
 >Re: Operations Beachball (From: Mike Abdullah <email@hidden>)
 >Re: Operations Beachball (From: "Gerriet M. Denkmann" <email@hidden>)
 >Re: Operations Beachball (From: Roland King <email@hidden>)
 >Re: Operations Beachball (From: "Gerriet M. Denkmann" <email@hidden>)
 >Re: Operations Beachball (From: Jens Alfke <email@hidden>)
 >Re: Operations Beachball (From: "Gerriet M. Denkmann" <email@hidden>)
 >Re: Operations Beachball (From: Joar Wingfors <email@hidden>)

  • Prev by Date: Re: NSOperation Efficiency
  • Next by Date: Re: NSOperation Efficiency
  • Previous by thread: Re: Operations Beachball
  • Next by thread: Re: Operations Beachball
  • Index(es):
    • Date
    • Thread