4 ms·
I suspect that this technology works by optimizing the kernel process scheduler by using some heuristics to determine what should be put to the background (e.g
by jasonjei 13y ago
I suspect that this technology works by optimizing the kernel process scheduler by using some heuristics to determine what should be put to the background (e.g determining what sort of syscalls are made, etc).
Will this technology be intelligent enough to know a network server process (e.g socket syscalls)? Will there be a user method to override/exclude this optimization on processes where this has an undesirable effect?
I think another good idea for OS developers is to push the concept of fibers more over threads. Often a multi-threaded application can be re-patterned to use fibers for immediate CPU optimization.
It sounds like a great OS improvement, especially coupled with SSDs. But I'm hoping we can turn the magic off for certain processes when the magic gets too crazy.
- LaGrange 13y ago"Will there be a user method to override/exclude this optimization on processes where this has an undesirable effect?" The answer to this is in the article: yes.
- wmf 13y ago"App Nap can be automatically triggered if an app’s windows are not visible and the app is not playing audio..." When they say foreground and background they're taking about the GUI. BTW, "developers can explicitly make an app ineligible for App Nap by using the existing IOKit IOPMAssertion API (used today in OS X to prevent the system from sleeping while an app is busy)."
- masklinn 13y agoThe developer documentation goes into more details: > App Nap reduces power consumption by completely suspending your app’s execution when it meets certain criteria. This ensures that your app does not periodically wake up to do unnecessary work. An app is considered to be a candidate for sleep if: > * It is not visible—if all of an app’s windows are either hidden by other windows or minimized in a hidden dock, and the app is not in the foreground > * It is not audible > * It has not explicitly disabled automatic termination > * It has not taken any power management assertions > When all of these conditions are met, OS X may put the app to sleep. While asleep, the app is placed on a scheduling queue that rarely gets actual time on the CPU. There are also new methods provided on NSProcessInfo to temporarily prevent sleep and increase scheduler timer precision.
- eddieplan9 13y agoThe article talks about three technologies, and IMHO none is about putting processes to background. The first one is about compressing pages instead of swapping them to secondary storage. This should be a net gain in almost all scenarios. The second - App Nap - only applies to GUI applications, and there are opt-out controls. The third - Timer Coalescing - is the only one that has the potential to alter application behavior, and it only kicks in when the machines runs on battery.
- masklinn 13y agoApple seems to expect App Nap might create issues, the developer docs for the feature have a note indicating: > Note: If you experience problems with App Nap, you can temporarily disable it for a particular process by typing: > defaults write <app domain name> NSAppSleepDisabled -bool YES > Immediately file a bug describing the app and explaining how to reproduce the problem.
- jemeshsu 13y agoApple's note does not imply it's a design issue. Just that the software is not ready and bugs are expected.
- masklinn 13y ago> Apple's note does not imply it's a design issue. At no point did I imply that. I was replying to eddieplan9's declaration that > Timer Coalescing - is the only one that has the potential to alter application behavior by noting Apple thinks App Nap may do so.
- kunai 13y agoYou can also disable the whole thing by typing in defaults write NSGlobalDomain NSAppSleepDisabled -bool YES
- jasonjei 13y agoI'm really hoping there's a GUI way for the average user to disable it. Otherwise, writing to plist is not something easily done by the average user. Some apps aren't readily updated. Another thing Apple might do is publish a list of App Names and version/build number metadata to automatically disable it for apps known to have problems with AppNap.