Disable App Nap on OSX 10.9+ #5041

pull fanquake wants to merge 1 commits into bitcoin:master from fanquake:disable_app_nap changing 1 files +3 −0
  1. fanquake commented at 11:38 am on October 4, 2014: member
  2. Disable App Nap on OSX 10.9+ 1f9be984db
  3. laanwj commented at 7:25 am on October 6, 2014: member
    utACK (should solve #3182)
  4. theuni commented at 8:31 pm on October 6, 2014: member
    utACK.
  5. theuni commented at 9:23 pm on October 6, 2014: member

    @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?

  6. fanquake commented at 0:41 am on October 7, 2014: member

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

    0beginActivityWithOptions:reason:
    1endActivity:
    2performActivityWithOptions: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

    0NSActivityIdleSystemSleepDisabled
    1NSActivitySuddenTerminationDisabled
    2NSActivityLatencyCritical
    
  7. laanwj commented at 7:04 am on October 7, 2014: member
    @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.
  8. laanwj merged this on Oct 7, 2014
  9. laanwj closed this on Oct 7, 2014

  10. laanwj referenced this in commit 2b5261c636 on Oct 7, 2014
  11. fanquake deleted the branch on May 12, 2016
  12. kittywhiskers referenced this in commit 937dc5ede1 on Jul 15, 2021
  13. kittywhiskers referenced this in commit 8d500d78fa on Jul 15, 2021
  14. DrahtBot locked this on Sep 8, 2021

github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2024-12-18 21:12 UTC

This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me