On Oct 18, 2009, at 7:26 AM, John Love wrote:
Thanks for your prompt reply, I really appreciate it.
You're welcome.
I have revamped my code to have just one NSInvocationOperation whose selector contains the long for-loop. [...] the long for-loop is within -doAllOperations.
OK, as far it goes.
It's my understanding from the docs and other Cocoa mailing list readers that when -addOperation: is called, a new background Thread is started up.
Well, you should stop trying to think about when exactly threads are started up (or how many there are, or how long they run, or exactly which one your operations run on, etc.). All of that is implementation detail about which you shouldn't care. The only important thing is that your (non-concurrent) operations will be run on some background thread that you are not responsible for setting up or managing. (If you implement concurrent operations, you still aren't guaranteed anything about on which thread your -start method is invoked, but you take responsibility for the execution context after that.)
If that is true, then my long for-loop should be executing in the background Thread. If I'm still on-track, then I have a problem in that I temporarily placed a NSLog() call within my -doCalculation, but nothing gets printed in my log. So, for the moment I am lost.
Well, there's no way for me to provide additional insight without seeing your code. If you suspect your code is blocked, you can sample your process (e.g. using Activity Monitor or the "sample" tool), which can show you where your threads are spending their time. You can also put may more logging statements throughout your code to track its progress. You can break into your program in the debugger and examine the various threads. Etc.
Regards, Ken _______________________________________________ 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: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com