Long-running computation "hangs" on MacOS (Mac mini M2)

Pages: 12
Random StackOverflow thread that might be related:
https://stackoverflow.com/questions/49677034/thread-sleeps-too-long-on-os-x-when-in-background

Apparently, "App Nap" was culprit for that person.

Interesting. "App Nap" could indeed be the problem here. Was suspecting something like that, but didn't know how it might be called!

Too bad that the suggested code to disable "App Nap" is in Objective-C++ 😱
Last edited on
Last edited on
Okay, I compiled the Objective-C version of disable_app_nap() with Clang and linked in the resulting .o file.

It also was necessary to add -framework Foundation to the linker options.

So far, it seems that the weird "delays" are no longer occurring, after "App Nap" has been disabled 😤
Last edited on
Heh, you put "App Nap" to sleep. If only temporarily. :Þ

Mac OS shows it can be as annoying as MS Windows from time to time. Hold the users' hand presuming they are all idiots while making things difficult for programmers.
Topic archived. No new replies allowed.
Pages: 12