Subj : Re: Memory Barriers, Compiler Optimizations, etc. To : comp.programming.threads From : Neill Clift [MSFT] Date : Mon Feb 07 2005 07:36 pm "SenderX" wrote in message news:F6-dnZxMFdIjZprfRVn-gw@comcast.com... >>> Is this safe? >>> >> >> Yes. As another poster mentions a less contrived example >> would be using say InterlockedCompareExchange to do >> one time initialization and if the call fails using the return >> as the initialized value. > > If the initialized value was a pointer to a new object, would the pointed > to object be fully visible? I mentioned this case in another post. I beleive that the answer should be yes and would likely log bugs if I found a current platform with an issue like this. Clearly you would need ordering on the creation side also. Neill. .