aboutsummaryrefslogtreecommitdiffhomepage
path: root/doc/TopicMultithreading.dox
diff options
context:
space:
mode:
authorGravatar Gael Guennebaud <g.gael@free.fr>2015-11-23 13:28:43 +0100
committerGravatar Gael Guennebaud <g.gael@free.fr>2015-11-23 13:28:43 +0100
commit31b661e4cad656611c322e7b61ad7b5e83c62207 (patch)
treed6216b55d0c6b834575d911761a3dabb1664066d /doc/TopicMultithreading.dox
parent8a2659f0cb2570c55d39036104860c656c9d3096 (diff)
Add a note on initParallel being optional in C++11.
Diffstat (limited to 'doc/TopicMultithreading.dox')
-rw-r--r--doc/TopicMultithreading.dox2
1 files changed, 2 insertions, 0 deletions
diff --git a/doc/TopicMultithreading.dox b/doc/TopicMultithreading.dox
index 95f6bf287..47c9b261f 100644
--- a/doc/TopicMultithreading.dox
+++ b/doc/TopicMultithreading.dox
@@ -43,6 +43,8 @@ int main(int argc, char** argv)
}
\endcode
+\note With Eigen 3.3, and a fully C++11 compliant compiler (i.e., <a href="http://en.cppreference.com/w/cpp/language/storage_duration#Static_local_variables">thread-safe static local variable initialization</a>), then calling \c initParallel() is optional.
+
\warning note that all functions generating random matrices are \b not re-entrant nor thread-safe. Those include DenseBase::Random(), and DenseBase::setRandom() despite a call to Eigen::initParallel(). This is because these functions are based on std::rand which is not re-entrant. For thread-safe random generator, we recommend the use of boost::random or c++11 random feature.
In the case your application is parallelized with OpenMP, you might want to disable Eigen's own parallization as detailed in the previous section.