1

I'm creating a daemon that will be installed in the LaunchAgents folder. Some questions about making it sleep:

  1. Because it's a LaunchAgent item will the executable automatically sleep when the user/system sleeps?
  2. If the answer is yes to question 1, do I need to specify anything in the plist document?
  3. If the answer is no to question 1, what is the best approach to deal with this problem?

Basically my app needs to sleep when the computer sleeps. What is the best way to make this happen in C or Cocoa?

Thanks!

Eric Brotto
  • 53,471
  • 32
  • 129
  • 174
  • This might be a silly question, but how exactly do you expect your app would continue running when the system sleeps? Typically, the CPU will be powered off... – Matt Gibson Jul 21 '10 at 13:40
  • The CPU is not powered-off. It's in low-power mode, and the RAM is also still powered. – Macmade Jul 21 '10 at 14:06
  • @Macmade Well, I was kinda oversimplifying... What instructions are being executed in the CPU in this low-power mode? – Matt Gibson Jul 21 '10 at 14:14

1 Answers1

1

You may find good answers on this question:
What happens to my app when my Mac goes to sleep?

Basically, the execution of your app will be freezed when the computer goes into sleep mode. It's automatically resumed when the computer wakes-up...

Community
  • 1
  • 1
Macmade
  • 52,708
  • 13
  • 106
  • 123