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

我与影子孤独终老i 提交于 2019-11-30 18:26:36

问题


So there's one piece of technology new to Snow Leopard that I haven't heard of. Sudden termination (see Sudden termination in this 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?


回答1:


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.




回答2:


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.



来源:https://stackoverflow.com/questions/4065429/are-there-drawbacks-to-snow-leopards-new-sudden-termination-mechanism

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!