Im working on an app where I have more different threads running at the same time, and using the same class object. I use mutex only when each thread wants to write to the class, but I wonder if I would have to use it also when each thread wants to read/access objects in class?
Thanks for help
It is fine for two threads to be reading the same object at the same time. However, if it is possible that one thread may be reading an object while another is writing to it, then you will need to use synchronization to prevent this.
Therefore, typically, all read and write access will be synchronized, because it is often not worth the effort to optimize for the multi-read scenario (known as the readers/writers problem).
I found a comparison of the different synchronization methods and an implementation of the fastest on MSDN if you're interested: