Implementation of the new TPool and ThreadPool classes#148
Closed
xvallspl wants to merge 9 commits into
Closed
Conversation
| template<class F> TObjArray Map(F func, TCollection &args); | ||
| template<class F, class T> auto Map(F func, std::initializer_list<T> args) -> std::vector<decltype(func(*args.begin()))>; | ||
| /// \cond | ||
| template<class F, class INTEGER> auto Map(F func, ROOT::TSeq<INTEGER> args) -> std::vector<decltype(func(args.front()))>; |
Member
There was a problem hiding this comment.
Can you use 'vectorstd::result_of<F::type>'? What if F returns a reference?
Contributor
Author
There was a problem hiding this comment.
Will check if the function returns a reference with an extra argument in the template, as seen here, which will trigger a nicer error for the user (at least in clang) when trying to pass a function whose return type is a reference.
For example: template<class F, class T, class noReferenceCond = typename std::enable_if<"Function can't return a reference" && !(std::is_reference<std::result_of<F(T)>>::value)>>.
This will be refactored using a templated alias:
template< class F, class... T>
using noReferenceCond = typename std::enable_if<"Function can't return a reference" && !(std::is_reference<typename std::result_of<F(T...)>::type>::value)>::type;
…lection overload, fixed headers and licenses
…, tutorials and TPool::Reduce type evaluation
… TObject. Fixed broken build
clang and llvm versions used in cling do not support openmp. This would break symmetry between what is available for user-compiled programs and what is available in the interpreter. OS X clang version does not support openmp yet either. Commits reverted: o ee75770 'fixed bugs in OMPThreadPool constructors' o a82731f 'added an OMP-based implementation'
Contributor
Author
|
Already Merged by Lorenzo. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Added the new ThreadPool class sharing TProcPool's MapReduce methods signature. Refactored the code so ThreadPool and TProcPool inherit from the new parent TPool.