• 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: Background Process?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Background Process?


  • Subject: Re: Background Process?
  • From: Roland King <email@hidden>
  • Date: Wed, 11 Mar 2009 14:17:01 +0800

Chris Suter wrote:

Hi Kyle,

On Wed, Mar 11, 2009 at 5:02 PM, Kyle Sluder <email@hidden> wrote:



Well, there is a sentence directly below that list that says the following:

"Because timers and other periodic events are delivered when you run
the run loop, circumventing that loop disrupts the delivery of those
events."

That sentence implies that the run loop must be run, either manually
or as the result of input coming in on an input source (which timers
are not), in order for the timer to fire.



Obviously, the run loop has to run, but you don't need events to be received or processed for the timer to fire. You need at least one event source, possibly a dummy one, but it doesn't have to do anything and so the CPU usage whilst waiting for the timer to fire will be zero.

Regards,

Chris


Yes I think by 'run' they mean you have called one of the NSRunLoop methods which start with the word 'run', not that it's poked into action and executing code. It can be 'running' and fast asleep.

What's the dummy source requirement? The NSRunLoop runxxx methods all say 'If no input sources or timers are attached to the run loop, this method exits immediately', which indicates a Timer alone is enough to keep the runloop running. I know however that a timer firing will not cause methods like runMode:beforeDate: to exit.

It would be odd if runloops only checked for timers when they happen to have been woken up by some other random event on another input source, you'd get totally inconsitent timers, the timer firings themselves must actually awaken the runloop from sleep.

_______________________________________________

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


References: 
 >Background Process? (From: Pierce Freeman <email@hidden>)
 >Re: Background Process? (From: Kyle Sluder <email@hidden>)
 >Re: Background Process? (From: Roland King <email@hidden>)
 >Re: Background Process? (From: Kyle Sluder <email@hidden>)
 >Re: Background Process? (From: Chris Suter <email@hidden>)
 >Re: Background Process? (From: Darren Minifie <email@hidden>)
 >Re: Background Process? (From: Michael Ash <email@hidden>)
 >Re: Background Process? (From: Kyle Sluder <email@hidden>)
 >Re: Background Process? (From: Roland King <email@hidden>)
 >Re: Background Process? (From: Kyle Sluder <email@hidden>)
 >Re: Background Process? (From: Chris Suter <email@hidden>)

  • Prev by Date: Re: Background Process?
  • Next by Date: Re: Background Process?
  • Previous by thread: Re: Background Process?
  • Next by thread: Re: Background Process?
  • Index(es):
    • Date
    • Thread