Originally Posted by
Clash
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.