By: Ricardo B (ricardo.b.delete@this.xxxxxx.xx), October 19, 2006 11:43 am
Room: Moderated Discussions
Tzvetan Mikov (tmikov@gmail.com) on 10/19/06 wrote:
---------------------------
>Another thread could see the write to m_cachedResult before it has seen the writes
>to newObject. So from that thread, m_cachesResult will point to an uninitialized object.
That's why Java has the "volatile" keyword for.
If m_cachedResult is voltatile, all previous writes will be made visible before the write to m_cachedResult.
---------------------------
>Another thread could see the write to m_cachedResult before it has seen the writes
>to newObject. So from that thread, m_cachesResult will point to an uninitialized object.
That's why Java has the "volatile" keyword for.
If m_cachedResult is voltatile, all previous writes will be made visible before the write to m_cachedResult.