Skip to content
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

Closed
wants to merge 9 commits into from

Conversation

xvallspl
Copy link
Contributor

Added the new ThreadPool class sharing TProcPool's MapReduce methods signature. Refactored the code so ThreadPool and TProcPool inherit from the new parent TPool.

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()))>;
Copy link
Member

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?

Copy link
Contributor Author

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
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'
@xvallspl
Copy link
Contributor Author

Already Merged by Lorenzo.

@xvallspl xvallspl closed this Apr 27, 2016
@xvallspl xvallspl deleted the TPool branch April 27, 2016 11:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants