Thursday, April 28, 2005 |
16:11 - Secret launch codes
http://arstechnica.com/reviews/os/macosx-10.4.ars/1
|
(top) |
Here's a long technical review of Tiger by John Siracusa; this chunk in the middle (via Kris) might be of interest to any Mac geeks of a UNIX-y bent, as well as to anyone keen on finding examples of how Apple seems intent on making Mac OS X into not just a better Mac OS than the Mac OS, but a better UNIX than UNIX:
Apple went down the same path as Solaris 10, adding its own XML-driven mechanisms for startup and login. The Unix community mostly ignored these efforts. They had their shell scripts, super daemons, and elaborate /etc/rc.d/ scaffolding.
But Apple is not your typical Unix vendor. While the new XML-based systems were nice, they represented two more systems in an already crowded field. In Tiger, Apple decided to tackle the program launching problem again, this time wiping the slate clean.
For Tiger, Apple created launchd: one launch daemon to rule them all. Launchd does the job of all of the existing program launching mechanisms, and does it in a way that puts the least possible burden on the programs that it launches. Processes spawned by launchd don't have to worry about "daemonizing" themselves, checking for dependencies, or relaunching or keeping communication handles alive in the case of a crash.
Launchd can launch programs in response to any of the events listed earlier, and it can do so on behalf of the system or an individual user. It will discover dependencies on its own and launch programs in parallel when possible. This is essential for fast system startup. Mac OS X's older startup items system did the same thing, but it had to be explicitly told the dependencies.
Launchd supports a messaging protocol to answer questions like, "How many users are connected to this daemon?" and "Have you shut down yet?" Program shutdown is another example of an area where "The Unix Way" is usually deemed "good enough" despite obvious deficiencies. Traditionally, Unix services are shut down by sending a signal to the process, waiting a little while, and then sending a more harsh signal just in case the service refused to shut down. This is barbaric, but necessary because there's no standardized messaging system for Unix daemons. Launchd recognized the need and filled it.
Apple has developed launchd as an open source project that it hopes will be adopted by the wider Unix community. To the average Unix hacker, launchd probably looks like a reinvention of the wheel. I think it addresses a problem the Unix community doesn't even know that it has. In this way it's much like Mac OS X itself. There was "Unix on the desktop," and then there was Mac OS X. You'd think that alone would have been a big enough wake-up call.
If I were working on a Unix-based operating system, I'd be borrowing ideas and code from Apple like there's no tomorrow.
The boys been busy, in other words. There's lots more, too—sections on the newly tuned-up, finely-grained kernel interface (upshot:no more waiting for the Finder while it juggles simultaneous network and filesystem access, previously the only two pathways into the kernel), and a new look at the potential richness and new usefulness of metadata (remember, Siracusa was the guy who led the charge against Apple's seeming abandonment of Type and Creator codes back in the early days of OS X, back before we realized that individually hideable, user-immutable filename extensions for file-typing and user-mutable "opener app" settings with global and per-file scopes was a much more flexible and sensible way to go anyway). He's also not very sanguine toward the new look of Mail, though aside from the toolbar buttons I like the changes. But he has very good things to say about the new Universal Type Identifiers, even if they're far from being a sexy feature that Apple can even talk about in the regular marketing material.
And at 6PM tomorrow, assuming Tiger Direct doesn't manage to go booga-booga-booga loudly enough to get Apple to rename everything they way they've already renamed "Rendezvous" to "Bonjour", we get to experience it all for ourselves.
|
|