Filed under: Developer, Snow Leopard
Mac 10.6 comes with license to kill
The name's Leopard... Snow Leopard... and how I wish it was 10.7 instead of 10.6 so I could extend these hokey James Bond allusions further. That said, it is closer than the truth than you may think. Apple has given Snow Leopard a license to kill... but this doesn't have anything to do with espionage or even spyware (pardon the pun). Instead, it has everything to do with Apple's desire to make the shutdown process faster.
One of the systemwide refinements tells us that "Snow Leopard is up to 80 percent faster when shutting down." If you've ever waited impatiently for your Mac notebook to shut down while your flight was boarding or at the end of the day when you are anxious to get home, Apple is looking to reduce that frustration.
Towards that end, Snow Leopard allows developers to mark their applications as "clean" or "dirty" -- not that kind of dirty!
Here's an example of what "clean" vs "dirty" means in this context: imagine you have been working in Pages, but all of your documents are saved (or maybe you've closed all the documents but Pages is still running). Pages can mark itself "clean" which is similar to saying "I'm ready when you are!"
Now imagine that you are working in Pages, and you've saved your file, but after you saved it you made some additional changes. Perhaps you have several documents open and unsaved, or you've got a Preferences dialog open. If you look at the 3 circles in the top-left corner of the window, you'll see that the one of the far left has a hole in the middle which goes away when you save the file. If any of those situations are true, Pages is considered "dirty," the programmatic equivalent of "Just a moment please!"
When the user tells the operating system to shutdown (not just sleep), the operating system will look to see which applications are "ready to go" and applications are still looking for their metaphorical keys. The ones that are ready? They get killed, and killed hard.
It's like the difference between telling an app to "Quit" versus "Force Quit." If you ask it to Quit, it is going to check to see if it needs to do anything before it does. If you tell it to Force Quit, it's just going to go away.
If you are familiar with the Terminal, you may have used 'kill' to stop some process from running. Usually if you want to 'kill' an application nicely, you send 'kill -TERM' ("software termination signal") which says "OK, clean up your things and let's go!" However if you find that something refuses to stop, you might use 'kill -9' which is referred to as SIGKILL, described as "non-catchable" and "non-ignorable." This is like picking up your child and carrying him or her away because it is time to go now with no questions asked. Applications which mark themselves as "clean" are telling the operating system: "You can use 'kill -9'/Force Quit on me without worrying about losing anything."
How much longer does "Quit" take compared to "Force Quit"? Maybe only a second or two, maybe a fraction of a second. But if you have a lot of applications running and the majority of them can skip that time, it helps the overall speed of the shutdown. Think of it like this: imagine you had a bunch of family members over and you were trying to get everyone out of the house to go to a restaurant: young kids, a couple of older aunts and uncles, and maybe grampa. You've probably asked something like this: "Does everyone have everything they need? Kids, did you go to the bathroom? Uncle Joe, did you get your coat and hat? Grampa, do you have your sweater in case it's too cold?" Even if everyone says "yes" it took longer than if you said "Let's go" and everyone replied "We're all ready!"
Is this a "sexy" feature of our newest cat-themed operating system? Not at all, but it is one of those "little details" that makes life a little easier as a Mac user: a little faster, a little more attention to detail, and exactly the sort of thing Apple promised to pay attention to with Snow Leopard.
(Big tip o' the hat to John Siracusa's epic Snow Leopard review at Ars Technica for bringing my attention to this feature. I look forward to John's operating system reviews almost as much as I look forward to the operating systems themselves.)
photo via flickr creative commons: danzen

![TUAW [Cafepress]](http://www.blogsmithmedia.com/www.tuaw.com/media/tuaw-cafepress-promo.png)


Reader Comments (Page 1 of 1)
mentalsticks said 11:02AM on 9-03-2009
May I compliment you on your metaphors?
Reply
Blackstar said 12:02PM on 9-03-2009
So, shutdown is faster, huh? Is that why it keeps hanging? I know, it's soooooo fast, it rebooted while I wasn't looking! Now that is fast. :P
Sorry to say, the finder is locking up and restart and shutdown options have frozen on more then one occasion on a brand new clean install of 10.6, so I think it being so new, they (Apple) still have a few bugs to work out.
TJ from TUAW said 1:27PM on 9-03-2009
You may indeed!
Does it show that we have a 7 year old in the house (and recently spent time with several other family members) ;-?
ars_workerbee said 11:37AM on 9-03-2009
Steven Degutis wrote about this from a developer's perspective last week, pretty interesting read, and useful if you want to know how to use this new stuff to make your apps better.
http://www.degutis.org/dev/2009/08/28/dear-devs-help-our-macs-quit-faster/
Reply
MikeWard1701 said 1:15PM on 9-03-2009
Interesting tech feature.
Is Force Quit the same as End Process/En Process Tree in the Windows Task manager?
Reply
TJ from TUAW said 1:30PM on 9-03-2009
I haven't used Windows on a regular basis for a couple of years, but I *believe* you are correct.
Cy Starkman said 8:19PM on 9-03-2009
Yup
walkerjs said 1:41PM on 9-03-2009
Well that's nice for the 8 or 9 times a year I actually shut my Mac down for software updates.
Otherwise sleep works quite nicely for when I need to up and leave with it.
Reply
ABCNEWSER said 8:34PM on 9-03-2009
Everyone says that super fast shut down is no big deal. I personally can't stand walking away from a computer for the day without making sure it's been completely shut down. I can't tell you how many times I've walked by a PC at school, or at someone's house and they think they've shut it down, when there's actually an "End Now" window or a "Send Error Report" window still open, holding up the whole shut down process. Their computer ends up staying on until the next time they use it. If that doesn't happen, people click "Shut Down" and ten seconds later they shut their laptop. Instead of shutting down, it just goes to sleep. Then when you open it back up to use it, you have to wait for it to shut down (45+ seconds on the Windows side) and then turn it back on again.
Having switched to Mac, on March 2, 2008, I've had a much better time. There are NEVER error windows before I shut down. Plus, the computer is completely shut down within 6 seconds! Which is nice, because I like to shut my MBP and unplug it (that green light would keep me up all night) when I'm done.
Reply
videoCWK said 11:49AM on 9-04-2009
Shutdown times have always been pretty quick for me (excluding when I still had FireFox on here). Maybe that's related to how I close all my programs before shutting down, which is a habit I still have from my PC days.
Reply