Re: [eigen] Status of non-OpenMP-based multithreading

[ Thread Index | Date Index | More lists.tuxfamily.org/eigen Archives ]




On Fri, Mar 4, 2016 at 9:45 PM, Benoit Steiner <benoit.steiner.goog@xxxxxxxxx> wrote:
This is correct, we currently rely on c++11 threads, mutexes and condition variables to implement the thread pool use in the tensor module. The main reason to do this is that c++11 is now very commonly available, so this makes the code very portable (at least more so that having to implement the functionality for every target platform).

A lot if not all the functionality is already abstracted: for example, the Notification class wraps the std::condition_variable, and the ThreadPool hides the std::thread class. It should be possible to reimplement both classes using boost to remove the dependency on c++11. 

I guess, that one could also implement one on top of openmp.
 
Last but not least, all the multithreading code is guarded by a EIGEN_USE_THREADS #define. I think it's pretty reasonable to require either c++11 or boost to be able to enable this #define.

What about enabling threads by default and are rather add a EIGEN_NO_THREADS?


gael


Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/