• 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: NSOperation Dispatch Thread Soft Limit
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSOperation Dispatch Thread Soft Limit


  • Subject: Re: NSOperation Dispatch Thread Soft Limit
  • From: Jens Alfke <email@hidden>
  • Date: Mon, 03 Mar 2014 08:14:12 -0800

On Mar 3, 2014, at 12:43 AM, Gerriet M. Denkmann <email@hidden> wrote:

> MyOperation does:
> 	create an NSOperationQueue
> 	add a few MyOperations to this queue
> 	waitUntilAllOperationsAreFinished
> (obviously this recursion stops at some point - I do not create an infinite number of operations).

NSOperation already has dependency settings so you can tell an NSOperation not to start running until dependent operations finish. You should be using that instead. Having large numbers of NSOperations blocked in mid-flight is bad for scalability, as you found, because it creates lots of threads.

It sounds like you’ve implemented some hierarchical algorithm in the simplest possible way. (Which is not an insult; one of the Agile principles is Do The Simplest Thing That Could Possibly Work.) The flip side of this approach is that when profiling shows you that the simple approach isn’t good enough, you have to go back and redesign it in a cleverer/faster way.

—Jens
_______________________________________________

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


  • Follow-Ups:
    • Re: NSOperation Dispatch Thread Soft Limit
      • From: "Gerriet M. Denkmann" <email@hidden>
References: 
 >NSOperation Dispatch Thread Soft Limit (From: "Gerriet M. Denkmann" <email@hidden>)

  • Prev by Date: Re: Public API method naming for NSString * / const char * parameters
  • Next by Date: Re: Public API method naming for NSString * / const char * parameters
  • Previous by thread: Re: NSOperation Dispatch Thread Soft Limit
  • Next by thread: Re: NSOperation Dispatch Thread Soft Limit
  • Index(es):
    • Date
    • Thread