Multi threaded insertion into STL Map
CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3

Thread: Multi threaded insertion into STL Map

  1. #1
    Join Date
    Jul 2007
    Posts
    233

    Arrow 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

  2. #2
    Join Date
    Oct 2008
    Posts
    1,168

    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.

  3. #3
    Join Date
    Jul 2007
    Posts
    233

    Re: Multi threaded insertion into STL Map

    Yes without synchronization there will be lot of problem.

    Thankss

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


Windows Mobile Development Center


Click Here to Expand Forum to Full Width

This is a CodeGuru survey question.


Featured


HTML5 Development Center