Do we need any synchronization, if multiple threads access
pair<iterator,iterator> equal_range (const value_type& val) const;
Since equal_range
is a read operation, it may not be required. Please comment.
Do we need any synchronization, if multiple threads access
pair<iterator,iterator> equal_range (const value_type& val) const;
Since equal_range
is a read operation, it may not be required. Please comment.
Like you said, since you are only "reading data" you don't need any synchronization, you can expect the function to be "thread-safe", see this question where the accepted answer states:
[17.6.5.9/3] A C++ standard library function shall not directly or indirectly modify objects (1.10) accessible by threads other than the current thread unless the objects are accessed directly or indirectly via the function’s non-const arguments, including this.