In C#, a class field means every thread has its own instance of that object.
E.g. thread 1 will have its own instance of object a, as will object b.
So 2 users of a web application, on different PCs, should be accessing an instance field (Say a collection) under different, threads, right?
This makes me beg the question, why would I need to write code to synchronise the collection? If the collection is instance based and not shared state.
Is it only in the fact that I may have another thread attempt to read the collection as I modify its state. I say "Is it" because this is only a possible case through code I actually write? E.g. spawn one thread to read a non-synchronised collection, and use the original thread to write to the collection. Or is there any other gotcha?
I have put this in the beginner section as this seems to be a fundamental question.
Thanks