On Apr 3, 2014, at 7:02 PM, Varun Chandramohan wrote:

> On 4/04/2014 10:47 am, "Jerry Krinock" <je...@ieee.org> wrote:
> 
>> On 2014 Apr 03, at 16:11, Varun Chandramohan
>> <varun.chandramo...@wontok.com> wrote:
>> 
>>> when I port the same code to be used as a user daemon, I noticed that
>>> NSOperationQueue fails.
>> 
>> I¹d suspect a run loop issue.  For example, maybe your daemon is exitting
>> before the operation begins.
> 
> Oh you mean, the runloop has not been initialised and the daemon is
> exiting before that?
> That could be the cause. Thanks I will investigate.

If the code that was shown was running on the main thread, then the process 
should not have exited.  The code called [queue 
waitUntilAllOperationsAreFinished].

In general, operation queues don't rely on the run loop.

It is correct that if the code shown was in a background thread and nothing was 
keeping the main thread from exiting, then the process will be terminated, 
likely before the operation finished (or maybe even started) executing.  
Parking the main thread in a loop running its run loop, assuming the run loop 
has at least one input source, is one way of preventing the main thread from 
exiting.  But that's the only tenuous relationship between run loops and 
operation queues.

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

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

Reply via email to