[Mondrian] Re: possible synchronization issue in mondrian?

John V. Sichi jsichi at gmail.com
Wed Apr 11 17:40:41 EDT 2007

[forwarding to mondrian developers]

Khanh, you are correct.  Double-checked locking has been known to be a
broken pattern for singletons in Java for years!  I would say go ahead
and fix it.  Follow the correct safe pattern from


Khanh Vu wrote:
> Hi John,
> I ran into an article arguing that using sync the way
> mondrian.test.TestContext.instance() is doing will not work
> http://java.sun.com/developer/technicalArticles/Programming/singletons/#resources
> (look in listing 4 for the source code)
> There are a couple arguments and proofs in one of the resource link
> listed at the bottom of lilsting 6 which involve compiler
> optimization. Since the article is a little bit old, I don't know if
> it is still an issue. Please advise.
> Thanks,
> Khanh.

More information about the Mondrian mailing list