开发者

Are there drawbacks to Snow Leopard's new "sudden termination" mechanism?

So there's one piece of technology new to Snow Leopard that I haven't heard of. Sudden termination (see Sudden termination in t开发者_如何转开发his Apple doc) is apparently a mechanism for telling the system when it is OK for your application to be killed brutally instead of going through the standard quitting mechanism. This is supposed to help faster log-off/power-off/hibernation.

First, I didn't know about it, didn't see it discussed here or anywhere, so: Is it used widely? What are the typical use cases (I imagine simple utility apps with no user documents or information to save)?

Second, the app can at anytime signal that it's unsafe to kill it, so it looks like there isn't really a drawback to this mechanism (except, of course, possible bugs in signaling safe/unsafe moments). Am I overlooking anything obvious?


There have been a few mentions in Apple mailing lists, such as: http://lists.apple.com/archives/cocoa-dev/2009/Sep/msg00113.html

Certainly you can use it in an app with user documents. As you say, the app can signal when it is or is not ready to be nuked, so it can just say "please don't kill me" if there are any unsaved documents. Of course you could also consider some kind of auto-saving scheme, which would make your app less vulnerable to crashes as well as more friendly to sudden termination.


Internally to Apple, the goal was that almost all processes should be suddenly terminable almost all of the time. It is something that all processes can and should use. Use case: everything!

Sudden termination is behind the "faster to shutdown" section on Apple's Snow Leopard page.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜