知识卡片
异常耗能任务可受限终止
对来源不明或能耗不可预期的任务,监测资源使用并在预定条件下中断,可提供兜底节能机制。手机无人响应时持续声响振动的任务是原章例子。监测有额外开销,终止可能违背用户意图,因此条件应结合任务重要性与体验,不应无差别杀掉后台工作。
这张卡片看不懂?
这张卡片已通过人工审查,不再接受失败反馈。
已有反馈 · 0 条
还没有人提交反馈。
在整书笔记中的位置
- · 第06章 能效
原书出处 · 1 处
- 能效 · 查看原书依据
This pattern provides a way to monitor the energy usage of such apps and to interrupt or kill energy-greedy operations. For example, if an app is issuing an audible alert and vibrating the phone and the user is not responding to these alerts, then after a predetermined timeout period the task is killed.
参考来源
- 位置:《Software Architecture in Practice, 4th Edition》第6章《能效》(来源项目:book-sources;源文件:extracted/Software Architecture in Practice, 4th Edition/_epub-src/ch06.html)
- 结论依据:原文的定义、机制或比较支持“对来源不明或能耗不可预期的任务,监测资源使用并在预定条件下中断,可提供兜底节能机制”;正文保留其条件与取舍。
- 原始内容:This pattern provides a way to monitor the energy usage of such apps and to interrupt or kill energy-greedy operations. For example, if an app is issuing an audible alert and vibrating the phone and the user is not responding to these alerts, then after a predetermined timeout period the task is killed.