Readonly Fields and Thread Safety
March 6, 2009
1 comment
In C# you can mark the fields of a type as readonly (indeed you generally should if it’s a struct). By doing so, you make it illegal to change the fields except in a constructor of the type.
The advantage of this is that readonly data can be shared freely between threads without any thread causing updates that may be seen "in progress" by other threads, simply because there never will be any updates.
But is this strictly speaking true? Nope.
