alibaba
alibaba

Reputation: 45

Is armadillo C++ matrix thread safe

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.

Upvotes: 2

Views: 929

Answers (1)

Maxim Egorushkin
Maxim Egorushkin

Reputation: 136465

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.

Upvotes: 3

Related Questions