|Re: [eigen] Status of non-OpenMP-based multithreading|
[ Thread Index |
| More lists.tuxfamily.org/eigen Archives
- To: eigen@xxxxxxxxxxxxxxxxxxx
- Subject: Re: [eigen] Status of non-OpenMP-based multithreading
- From: Benoit Steiner <benoit.steiner.goog@xxxxxxxxx>
- Date: Fri, 4 Mar 2016 12:45:15 -0800
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to; bh=Nl3X/hYxWw53lj8A8lPGJpyVrN32E+MhQGRDkIV+hpg=; b=UEWFwaii/Vddjp+TYY6XXnqdqZzXm6Tl29hxGtgpglvl0upDv4iSAhw/bQ9vh33bVI MyDmXzwV6M1sHJL8ij1rv7li4vOQu8zpZ+b08v93jipmhd+yk9UG+UPl8NG0NEW4Y/X6 gUQnhv9qTZyWw7eNcvX/9K0Hb1wQ/Sc8QRzHryXOokNRXwzvbj2pzKTf9FAidfAghDim iwYuZBsUEm+fWV5sXtSTqATmmKHIbOnhdA0r+zggCDjRIzOaXA+GJJPDE5zuDZ/Pd71r WRNuOzk4sLyy2o/9fpYtny/YfTKkpk8hbMx1BfM8wuxhrSngeHKbWRUAFBKEFq/nBGa4 22Uw==
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.
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.