site_archiver@lists.apple.com Delivered-To: darwin-kernel@lists.apple.com Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s1024; t=1257504620; bh=+eGutZ/r8esMSN29l5LePrslzep3VC9dxvd+Ji6x9G4=; h=Message-ID:X-YMail-OSG:Received:X-Mailer:Date:From:Subject:To:Cc:In-Reply-To:MIME-Version:Content-Type:Content-Transfer-Encoding; b=gdsdAdiRuCqN2txHVwe0u16sUSpOiO9hvZgfIejACuZr3h+vB0KkL/Zq/Dl5zUf35o5iFSni0zDQEM+naQER0sSCcdM8zGO7vmM/cHKCqRUA9KVMTmMLF9jk/kvNcvkUD02vMhAZ+zijQxSpZuMyTgQCfPLfij7ZjLPEbenKIco= Domainkey-signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.com; h=Message-ID:X-YMail-OSG:Received:X-Mailer:Date:From:Subject:To:Cc:In-Reply-To:MIME-Version:Content-Type:Content-Transfer-Encoding; b=whtVzPbI35ohqKpOciep6oFafwVkfpI/Nt/MtySvGz5e0f7QmX8KASeRR7037PbZpsgg4DuEyrXt0wu+Dv5wc3dm57EGARHX9kJMdZmjqUmaXLn6kAaLBtdLluvBKN+aPZwWsLT7j4qxj2GgEYU5ywUwJB6q4xB0bDLXYUPdxKA=; Hi Ethan Thanks for the response. My queries on your suggestion of launch-on-demand launch daemon are below: 1. The daemon I was referring to is an always-load launch daemon (i.e., OnDemand is set to false). We want the daemon to be always alive. So, is there a way that I make OnDemand setting to true but want the daemon to be always alive? 2. My understanding of OnDemand setting is that, the daemon will be triggered on demand if OnDemand is set to true. In such case, I guess I need to write the logic to trigger the daemon. Is there any simple logic that I can add so that daemon will be triggered without impacting boot times? Thanks Anil Kumar --- On Fri, 6/11/09, Ethan Bold <ebold@apple.com> wrote:
From: Ethan Bold <ebold@apple.com> Subject: Re: OS startup done event To: "Anil Kumar K" <k_anilk@yahoo.com> Cc: "Shantonu Sen" <ssen@apple.com>, "darwin-kernel Kernel" <darwin-kernel@lists.apple.com> Date: Friday, 6 November, 2009, 6:04 AM Hi Anil, Shantonu-
The SystemLoadAdvisory mechanism is an inappropriate choice here. It will report when it's appropriate to run speculative work (like re-building an index, or refreshing a web page, or XCode doing a speculative build...). The goal is for processes to take the "Good", "OK", "Bad" responses as guidelines, and change the frequency of their speculative actions. A lot of these things still need to happen when the system is "Bad", but should be done less frequently.
Given that, and given that the system might never reach an "OK" level (it could always be Great, or Bad), you should find another solution to this problem. SystemLoadAdvisory has nothing to do with when the system is initially available.
So - you want to delay the CPU-intensive initialization time of your service until after boot, so as not to affect boot times. Have you considered becoming a launch-on-demand launch daemon? That way you could defer your initialization costs until you're first accessed. This is what I'd recommend you look into, without knowing more about your problem.
-Ethan
On Nov 5, 2009, at 3:35 AM, Anil Kumar K wrote:
Hi Shantonu
Sorry for the late response. Can you please provide sample code on this. I had seen the header file you suggested but I am confused as to what APIs to call.
Thanks Anil Kumar
--- On Tue, 27/10/09, Shantonu Sen <ssen@apple.com> wrote:
From: Shantonu Sen <ssen@apple.com> Subject: Re: OS startup done event To: "Anil Kumar K" <k_anilk@yahoo.com> Cc: "darwin-kernel Kernel" <darwin-kernel@lists.apple.com> Date: Tuesday, 27 October, 2009, 7:27 PM "OS Startup" is never really done. That said, <IOKit/pwr_mgt/IOPMLib.h> has some APIs related to system load. You can start up and wait for the load to reach an "OK" level (yes, that's a technical term), or some outer bound timeout like 10 minutes.
Shantonu
Sent from my MacBook
On Oct 27, 2009, at 6:07 AM, Michael Crawford wrote:
On Tue, Oct 27, 2009 at 4:45 AM, Anil Kumar K <k_anilk@yahoo.com> wrote:
I have a daemon which has to provide some service. I would like to delay providing this service till completion of the OS startup (all OS daemons are up and running) so that it does not affect boot time. Service initialization is a cpu intensive activity. Is there any OS event to know whether the startup is completed or not?
Does the login screen have some particular process name? Perhaps you could poll for its existence, then sleep a few seconds, and iterate until it appears.
However the user might have selected automatic login - to handle that one would need to watch for the Finder to appear as well.
Mike -- Michael David Crawford mdcrawford at gmail dot com
GoingWare's Bag of Programming Tricks http://www.goingware.com/tips/
Do not post admin requests to the list. They will be ignored. Darwin-kernel mailing list (Darwin-kernel@lists.apple.com) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/darwin-kernel/ssen%40apple.com
This email sent to ssen@apple.com
Connect more, do more and share more with Yahoo! India Mail. Learn more. http://in.overview.mail.yahoo.com/ _______________________________________________ Do not post admin requests to the list. They will be ignored. Darwin-kernel mailing list (Darwin-kernel@lists.apple.com) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/darwin-kernel/ebold%40apple.com
This email sent to ebold@apple.com
Yahoo! India has a new look. Take a sneak peek http://in.yahoo.com/trynew _______________________________________________ Do not post admin requests to the list. They will be ignored. Darwin-kernel mailing list (Darwin-kernel@lists.apple.com) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/darwin-kernel/site_archiver%40lists.a... This email sent to site_archiver@lists.apple.com
participants (1)
-
Anil Kumar K