Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Related issue
#165
Problem with helgrind
When tested with valgrind --tool=helgrind tests/unit_tests, the output is like:
Then I checked source code of glibc, and get
at the line mentioned in helgrind. This line of code belongs to the function used to create threads in GLIBC's nptl module, so it looks like helgrind detected it during a concurrent call to std::async. In my test, the warning can be supressed by locking the std::async like:
You can also reproduce the problem with helgrind from the following code:
So yes, the warning of helgrind is false positive, helgrind just warns when you create threads concurrently with glibc.
Performance
The performance improvement depends on the number of threads. In my tests, concurrent builds with 8-16 threads can improve building performance by up to around 3x.