Skip to content

Conversation

@fanquake
Copy link
Member

@fanquake fanquake commented Oct 4, 2014

No description provided.

@laanwj
Copy link
Member

laanwj commented Oct 6, 2014

utACK (should solve #3182)

@theuni
Copy link
Member

theuni commented Oct 6, 2014

utACK.

@theuni
Copy link
Member

theuni commented Oct 6, 2014

@fanquake I looked around a bit for APIs we should be using, rather than disabling the functionality completely. I assumed that there would be some calls we could make before/after initiating some network activity (not that it would be useful for us, probably, given the nature of p2p), but I was disappointed in the documentation.

Basically, I would like to know how a network-heavy application should work with AppNap without disabling it, if only for my own edification. Have you stumbled onto anything along those lines?

@fanquake
Copy link
Member Author

fanquake commented Oct 7, 2014

@theuni It looks the like we'd be using methods out of the NSProcessInfo Class.

beginActivityWithOptions:reason:
endActivity:
performActivityWithOptions:reason:usingBlock:

They allow you to temporarily suspend idle sleep, display sleep, sudden termination, and automatic termination for the duration of a particular operation as well as allow an app to temporarily increase the scheduler timer precision while it is performing latency-critical operations.

Then we'd pick the right option flags for what we'd like to do, something like

NSActivityIdleSystemSleepDisabled
NSActivitySuddenTerminationDisabled
NSActivityLatencyCritical

@laanwj
Copy link
Member

laanwj commented Oct 7, 2014

@theuni The problem is not network-heavyness but the CPU heaviness of validating blocks. People complain that app nap slows down the sync due to that. Maybe it could re-enable it after it deems itself up to date.

@laanwj laanwj merged commit 1f9be98 into bitcoin:master Oct 7, 2014
laanwj added a commit that referenced this pull request Oct 7, 2014
1f9be98 Disable App Nap on OSX 10.9+ (Michael Ford)
@fanquake fanquake deleted the disable_app_nap branch May 12, 2016 14:15
@bitcoin bitcoin locked as resolved and limited conversation to collaborators Sep 8, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants