分类: LINUX
2008-03-13 21:07:17
Maemo Launcher
Maemo launcher launches all applications on the maemo platform. It is there to speed up application startup by sharing some of the initialization data of an application startup. Maemo Launcher is composed of two parts: (i) the maemo-invoker, which is executed by D-BUS daemon or scripts to start the given (application) service, and (ii) maemo-launcher, a server that has initialized most of the data used by the applications.
The maemo-invoker asks maemo-launcher to start the actual application. Use of maemo launcher requires that application is compiled as a shared library. There's a set of helper Debian package rules which make an application to “automatically” use maemo-invoker when given suitable build options. As a result, the application binary name is linked to maemo-invoker and application (library) binary name has .launch extension. By default the invoker will wait until the maemo-launcher tells it that the application has exited so that it can return the correct return value for the caller.
The maemo-launcher is a server process that has initialized most of the data used by the applications, such as Glib types, Gtk theme and some Gtk widget classes. When it's asked by maemo-invoker to start an application, instead of executing the application binary, it will dl-load that as a shared library, fork and call main(). With fork, the initialized data is handled as copy-on-write, i.e. shared until it's modified. If the application exits abnormally, maemo-launcher notifies Desktop so that Desktop can inform user about it.
Because prelinking doesn't work with dl-loaded libraries, maemo Launcher cannot speed up starting of applications where library linking has larger effect on the startup time than AF library initializations. It can still save memory though.