Not sure if that is the cause, but you definitiely should NOT do client.Add in one thread and client.Remove in another, you need mutex serialization for that...
Mirek
More interesting question is whether I can use Add and operator[] (protected by mutex) at the same time in two different threads . Vector manual states that Add "Invalidates iterators and references to Vector."
If it is protected by mutex, you can.
Of course, what you cannot is to take a reference (pointer) to element and then unlock the mutex and use this reference. But that is sort of same in single-threaded.
Using Mutex is no magic - each time you need to access a shared variable, you need to "lock" it, so that other thread does not change its content during operation...