Armadillo is a C++ linear algebra library. I wonder if its implementation is thread safe? For example, I have a matrix A, and there are 2 threads modifying it. I looked at its documentation but this is not mentioned.
Asked
Active
Viewed 865 times
2
-
For all C++ libraries... if it isn't mentioned, it's probably not thread safe. – Alessandro Pezzato Sep 04 '14 at 08:09
-
Related: [Is armadillo solve() thread safe?](http://stackoverflow.com/questions/30063240/is-armadillo-solve-thread-safe) – Brent Bradburn Oct 22 '15 at 00:29
1 Answers
3
You can safely assume that everything is not thread-safe by default, unless stated otherwise.
This is because thread-safety adds overhead (locking) that would penalize single-threaded usage for no good reason. E.g. you can use a matrix in a multi-threaded application without ever sharing it with other threads.

Maxim Egorushkin
- 131,725
- 17
- 180
- 271