• 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: NSRunLoop's limitDateForMode: returns nil
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSRunLoop's limitDateForMode: returns nil


  • Subject: Re: NSRunLoop's limitDateForMode: returns nil
  • From: Mont Rothstein <email@hidden>
  • Date: Wed, 5 Jan 2005 17:08:22 -0800

A little more info.

This application has a command line flag, to run in a watch dog mode (fork a child and re-start if it dies), or not. When I don't use the watch dog mode (i.e. no forking) everything works fine.

In the watch dog mode the parent registers an atexit() and a bunch of signal()s. It then calls fork() and sits around via waitpid() until the child dies.

The child then registers the same atexit() and signal()s, plus some additional signal()s and then executes exit() where the parameter to exit() is the same call used when not running in watch dog mode.

In both cases (watch dog or not) NSTimer's scheduleTimerWithTimeInterval:... is called with an interval of 120.

In the non-watch dog execution limitDatForMode seems to return a time based on this interval, in the watch dog child it returns nil.

In both cases I guess you would call these Cocoa tools, they do not use NSApplication, but have their own application and manage their own run loop. They are web apps receiving HTTP calls from Apache.

I hope this paints a clearer picture. This all comes from an open source framework I am using and no one working with that framework seems to have any idea why this isn't working for me.

I really appreciate your help with this.

Thanks,
-Mont

On Jan 5, 2005, at 10:13 AM, Shawn Erickson wrote:

On Jan 5, 2005, at 10:04 AM, Mont Rothstein wrote:

I have a call

	[loop limitDateForMode:NSDefaultRunLoopMode]

that under certain circumstances returns nil. The docs say this will happen if there are no input sources, but not (that I can find) what would cause there to be no input sources.

This occurs in a child process forked off of a parent. The idea is that the parent restarts the child if it dies. The child is a server process talking to an http server.

Anyone have any ideas on what could cause there to be no input sources and therefore return nil from the above call?

Are any input sources being added to the run loop? You want to add such sources (directly or indirectly) before running the run loop.


Also you are talking about processes... do you mean threads instead? Just making sure I understand what you are talking about.

What is the child "process"? AppKit application, Cocoa tool, etc?

-Shawn


_______________________________________________ Do not post admin requests to the list. They will be ignored. Cocoa-dev mailing list (email@hidden) Help/Unsubscribe/Update your Subscription: This email sent to email@hidden
References: 
 >NSRunLoop's limitDateForMode: returns nil (From: Mont Rothstein <email@hidden>)
 >Re: NSRunLoop's limitDateForMode: returns nil (From: Shawn Erickson <email@hidden>)

  • Prev by Date: Re: Cocoa Bindings - nondebuggable, non-obvious, procedural ???
  • Next by Date: NSMutableDictionaries as object implementation (was Re: Cocoa Bindings - nondebuggable, non-obvious, procedural ???)
  • Previous by thread: Re: NSRunLoop's limitDateForMode: returns nil
  • Next by thread: bind:toObject:.. should set value in bindor?
  • Index(es):
    • Date
    • Thread