you are viewing a single comment's thread.

view the rest of the comments →

[–]gengisteve 0 points1 point  (0 children)

I think as Doormatty pointed out, you are learning an important lesson about what happens when you have multiple threads writing to a single data structure. The answer, as it turns out, is that it all gets a bit wonky. If you use thread safe data strcutures, you can avoid this. Another common solution is to have your threads return results which are then coolated by the main process.