Snow Leopard的新“突然终止"功能是否存在缺陷?机制? [英] Are there drawbacks to Snow Leopard's new "sudden termination" mechanism?

查看:107
本文介绍了Snow Leopard的新“突然终止"功能是否存在缺陷?机制?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

因此,我没有听说过Snow Leopard的一项新技术.突然终止(请参阅突然终止). html"rel =" nofollow>此Apple文档)显然是一种机制,用于告知系统何时可以残酷地杀死您的应用程序,而不是通过标准的退出机制.这应该有助于更快地注销/关闭电源/休眠.

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?

推荐答案

Apple邮件列表中有一些提及,例如:

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.

这篇关于Snow Leopard的新“突然终止"功能是否存在缺陷?机制?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆