what do you mean simultaneously i mean it cant happen all at the same time right ... Zaita is right you need locks or at the very least some sort of passport system so you don't get some threads accessing it multiple times before others get to it right?
Multiple threads can trivially read an array safely if none of them are modifying it.
C-stlye arrays (mening the iterator is really a pointer) may be thread safe, if it's an array of "atomic" types, such as an array of ints.
STL containers are not threadsafe (unless you have library created just for that purpose), so you'll need some locking mechanism if you want multi-threaded access to a non-constant container.
And always remember that adding a new element to a vector can invalidate all iterators, whether you have one thread or many.
Ok. Lets talk about constant array: if multiple threads are reading it at the same time, they must maintain each its own index for array. The problem is: how to initiate that index and use for easy accesses? I mean, without messing with it locally where the while loop is; similar approach can be seen when some kind of iterators are used...
If its trivial, please post...