|
-
December 7th, 2008, 05:44 PM
#1
std::map iterator
Hello!
I have a multithreaded application that every frame iterates through a map. The problem is, one of the threads might remove one element of the map and the other one could be iterating through the map, this is bad, correct? I could instead of directly removing, just mark the element for elimination and before the loop that iterates through the elements remove those elements. Is this the recommended way, is there another way or am I just doing everything wrong?
If I haven't gave enough information please tell me. Thanks in advance guys.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|