I have a function that ask for a reference to a constant std::vector.
Example:
bool DoSomething(const std::vector<int>& data);
The thing is, I would like this function to be multi-threaded. I've learned, by reading tutorials, that any data that is not local, should be protected by for example a mutex. But the tutorials assumed that the data that needed protected would be modified by the multi-threaded function.
Now the question is, does any data that is constant or is guaranteed to not be modified need a kind of protection? I assume here that only one function will access the data, although this function will be run in multiple threads.
I thank you in advance.