-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Implementation of the new TPool and ThreadPool classes #148
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()))>; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you use 'vectorstd::result_of<F::type>'? What if F returns a reference?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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'
Already Merged by Lorenzo. |
Added the new ThreadPool class sharing TProcPool's MapReduce methods signature. Refactored the code so ThreadPool and TProcPool inherit from the new parent TPool.