hi guys,
i cant made up my mind about this.
if i have an stl vector with n elements that will never change its content,
and there are two threads accessing this vector for read purposes only,
do i need to synchronize this object ?
thanks
Printable View
hi guys,
i cant made up my mind about this.
if i have an stl vector with n elements that will never change its content,
and there are two threads accessing this vector for read purposes only,
do i need to synchronize this object ?
thanks
I don't think you need synchronization to share the vector in read mode. Just make sure that only the vector is shared, not the iterators.
No synchronization is required if all threads are read-only.
However, make sure the vector is completely populated prior to starting the threads.