• 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: Kyle Sluder <email@hidden>
  • Date: Tue, 10 Mar 2009 22:19:49 -0400

On Tue, Mar 10, 2009 at 9:49 PM, Roland King <email@hidden> wrote:
> Could you expand on that a bit please? My mental picture of the runloop has
> always been more like a select() which does nothing unless there is
> something to do. Not that I ever quite sorted out in my own mind how an
> NSTimer fits is something you can select() on. Does the runloop actually
> poll a whole lot even when it has nothing to do?

While NSTimers are not normal input sources, the frameworks are free
to add any input source to the runloop that they wish.  And in order
for your timer to fire, you need to keep the runloop awake, using at
least a dummy input source.  See "Timers" in "Timer Programming Topics
for Cocoa":

"A timer is not a real-time mechanism; it fires only when one of the
run loop modes to which the timer has been added is running and able
to check if the timer’s firing time has passed."

http://developer.apple.com/documentation/Cocoa/Conceptual/Timers/Articles/timerConcepts.html#//apple_ref/doc/uid/20000806

So your process will need to remain awake, which means that the
processor needs to be that much more active.

--Kyle Sluder
_______________________________________________

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: Background Process?
      • From: Chris Suter <email@hidden>
References: 
 >Background Process? (From: Pierce Freeman <email@hidden>)
 >Re: Background Process? (From: Daniel Richman <email@hidden>)
 >Re: Background Process? (From: Kyle Sluder <email@hidden>)
 >Re: Background Process? (From: Roland King <email@hidden>)

  • Prev by Date: Fwd: Background Process?
  • Next by Date: Re: What is using up so much memory here?
  • Previous by thread: Re: Background Process?
  • Next by thread: Re: Background Process?
  • Index(es):
    • Date
    • Thread