Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

NSOperationQueueDefaultMaxConcurrentOperationCount in the wild

The Apple docs say that if you set the maxConcurrentOperationCount property of an NSOperationQueue to NSOperationQueueDefaultMaxConcurrentOperationCount (the default) then it will adjust the value at run time based on "system conditions".

If you specify the value NSOperationQueueDefaultMaxConcurrentOperationCount (which is recommended), the maximum number of operations can change dynamically based on system conditions.

Can anyone report what they are seeing that value being set to in the wild on different devices? Are we talking 1 or 2 for old phones and 3-4 for new models, or 10 or ?? It does not give any insight into the possibility set or most common result. I think it would be useful for developers to know what to expect to happen in production, rather than just we'll take care of it without any explanation of what they are optimizing for (UI responsiveness, operation execution speed, etc).

like image 946
Joel Avatar asked May 04 '12 01:05

Joel


1 Answers

As it said in many different variations and resources (for instance), you never know how many threads you should create for your application's workflow.

It's a matter of CPU time and load how much threads your application needs (because it's not alone in the woods). So, answer is:

  1. optimization for number of cores
  2. optimization for CPU architecture
  3. optimization for current CPU load
like image 90
art-divin Avatar answered Sep 20 '22 11:09

art-divin