Preface: I know how to create a read-only CultureInfo object. That is not the question and it has been answered in detail here:
Note that the text of that question is similar to this one, but the answers are completely different. Before thinking about closing this question as a duplicate of the other one, please consider the fact that none of the answers in the other question answers this question.
My question:
Is it thread-safe to access instance members of a read-only CultureInfo object?
Reasons to assume that it is:
If it weren't, using instance members of
CultureInfo.InvariantCulture
or objects retrieved byCultureInfo.GetCultureInfo
wouldn't be thread-safe, and a lot of code would break.The community seems to think so (see Henk's comment on this answer), but does not explain why.
Reasons to assume that it isn't:
No such garantee is made in the MSDN documentation ("Any instance members are not guaranteed to be thread safe.")
People often confuse "read-only" and "thread-safe", although they are two different things.
InvariantCulture
is a static, as isGetCultureInfo()
. – SulphuricInvariantCulture.Calendar
, for example, is a member access, and, thus, not guaranteed to be thread-safe. – Falk