Multi threaded insertion into STL Map
Suppose multiple threads are are trying to insert into a STL Map, both are trying to insert with same key. As per my understanding it will not cause any issue till you invalidate the iterator. Here as per me it will not invalidate the iterator.
Please share your views
Re: Multi threaded insertion into STL Map
without synchronization, you'll have race conditions ( = really bad :) ). That said, yes, iterators are not invalidated by insertions, but again, without synchronization anything can happen.
Re: Multi threaded insertion into STL Map
Yes without synchronization there will be lot of problem.
Thankss