Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.Sign up
Incompatibility issues caused by #593 #597
With PR #593 by @fedux the code for creating and synchronising threads has been reworked to use standard facilities of C++11:
All seemed fine: compilation worked on Mac, Windows and on Linux (tested via Travis CI). Compatibility with many systems is a major priority for NZBGet project. To catch potential compatibility issues we have Travis CI tests that compile nzbget using GCC 4.8 (among other versions), which is the oldest supported compiler. These tests succeeded.
After merging PR #593 I was making performance tests on ARM platform (ARMv7 CPU, armhf target). Unfortunately that didn't go well. The program crashed on start. After investigating the issue the problematic places were:
In both cases the library code throwed exception
Before that another issue was found: the compilation for armel target failed. In that case the compiler feature
I could possibly update build machine to newer GCC version which would hopefully fix issues with
Increasing system requirements of nzbget must be adjusted with a very big gain. The rework of thread management code was initiated by #351. Decrease idle cpu/power usage has however far less importance than compatibility with many platforms. Moreover the changes in #593 which directly address idle CPU usage rely on only one new (previously not available in nzbget code base) thread management facility - condition variables.
The plan to fix compatibility issues but keep improvements addressing idle CPU usage is: revert all threads management code back (use OS specific code) and implement condition variables using OS-specific code.
In any case, my interest in working in this project was to solve the CPU idle usage and learn/practice the C++11/14 features at the same time, but now that these features can't be used it makes more sense for me to continue work in my own fork. I will try to send you any fixes that I see while at that. :)
I wasn't getting the message "Enable multithreading to use std::thread: Operation not permitted" and the flags didn't help. But the last post mentioned static linking and that got my attention because static linking is usually troublesome. I then checked if x86_64-build worked and it didn't. So the problem wasn't specific to ARM-target and I knew for sure that x86_64 should not have troubles with
After further googling I found this post. Apparently linking
GCC devs think:
Anyway with the new flags the targets x86_64 and armhf started to work!
With the hope that all other platforms work as well I've brought back
I need to do more tests on all available platforms, just to be sure, before merging into develop.
@fedux: Thank you for the hint and for all original changes regarding idle CPU usage. You whole work is preserved, don't worry! I'm also going to merge your changes to article cache manager. Although you closed the PR I still have access to changes; maybe you can post a new PR if you want, once branch 597-concurrency (where I make current changes) is merged into develop.
I have several other changes in my fork but I'm trying to only do internal changes and keep it compatible with your main work. Eventually I will probably get bored but you will continue with the main project. Some of the changes could be cherry-picked and maybe you could also get some ideas.
Anyway, I'll do the new PR after your changes.