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

Re: NSOperation Issues


  • Subject: Re: NSOperation Issues
  • From: Ken Thomases <email@hidden>
  • Date: Thu, 03 Apr 2014 19:16:33 -0500

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

> On 4/04/2014 10:47 am, "Jerry Krinock" <email@hidden> wrote:
>
>> On 2014 Apr 03, at 16:11, Varun Chandramohan
>> <email@hidden> 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 (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 Issues
      • From: Varun Chandramohan <email@hidden>
    • Re: NSOperation Issues
      • From: Varun Chandramohan <email@hidden>
References: 
 >NSOperation Issues (From: Varun Chandramohan <email@hidden>)
 >Re: NSOperation Issues (From: Jerry Krinock <email@hidden>)
 >Re: NSOperation Issues (From: Varun Chandramohan <email@hidden>)

  • Prev by Date: Re: NSOperation Issues
  • Next by Date: Re: NSOperation Issues
  • Previous by thread: Re: NSOperation Issues
  • Next by thread: Re: NSOperation Issues
  • Index(es):
    • Date
    • Thread