View Full Version : [Mondrian] Re: possible synchronization issue in mondrian?

John V. Sichi
04-11-2007, 05:43 PM
[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.

Mondrian mailing list
Mondrian (AT) pentaho (DOT) org