Sharring variables between multiple threads.
Posted on 2006-06-15
I need to know the right way of sharing data between different threads. I have a main thread which is going to spawn about 10 different instances of the same worker thread. These worker threads are going to collect information and put them each into a seperate instance (or array member) of the same structure. So I would like to end up with an array of the structure (myStructure) whose members were populated by ten different threads simultaniously. What's the excepted way of doing something like this?