That's true. In the example I gave (Mac driver loading), each module
has a property list that lists its dependencies (and version
requirements, etc.). That's not quite as simple to do inside a single
application, of course, but having code do the ordering still seems
like a win to me.
Consider startup as a sequence of, say:
Initializer foo("foo");
foo.DependsOn("bar");
foo.DependsOn("zot");
Initializer alice("alice");
alice.DependsOn("bob");
alice.DependsOn("eve");
[...]
Initializer::LaunchAll();
(or, more generally, "Initializer:::Launch("chromium");" where
"chromium" is a top level module, so that the general framework could
be used for things besides app launch)
Just some ideas,
--Amanda
On Thu, Jan 15, 2009 at 4:04 PM, Erik Kay <[email protected]> wrote:
>
> On Thu, Jan 15, 2009 at 11:11 AM, Ben Goodger (Google) <[email protected]>
> wrote:
>> I'm not coming at this from an optimization perspective, I'm thinking
>> more of making the startup flow understandable to mere mortals.
>
> Amanda's suggestion would likely actually accomplish both, so I don't
> think we should dismiss it if it happens to make startup faster as a
> result as well. :-)
>
> The gist would be to have some way for a given service to specify its
> startup dependencies. Once you do that, then you can essentially list
> your startup services in pretty much any order since the dependencies
> would get worked out correctly. It would also allow us to catch
> things like dependency cycles and to more clearly figure out how to
> optimize startup time by perhaps figuring out how to remove
> unnecessary dependencies. Finally, it would allow easier unit testing
> since you'd be able to safely grab a subset of the services you want
> to test and to have a system that knows how to initialize properly
> (addressing Scott's issue).
>
> Of course, coming up with a nice way to express these dependencies
> cleanly and actually figuring out what all of the dependencies are are
> both easier said than done.
>
> Erik
>
> >
>
--~--~---------~--~----~------------~-------~--~----~
Chromium Developers mailing list: [email protected]
View archives, change email options, or unsubscribe:
http://groups.google.com/group/chromium-dev
-~----------~----~----~----~------~----~------~--~---