[9] RFR(S): 8005873: JRuby test_respond_to.rb asserts with: MT-unsafe modification of inline cache

John Rose john.r.rose at oracle.com
Mon May 19 18:31:55 UTC 2014

On May 16, 2014, at 4:56 AM, Tobias Hartmann <tobias.hartmann at oracle.com> wrote:

> Is it sufficient then to use synchronized (lambdaForms) { ... } in setCachedLambdaForm(..) and a normal read in cachedLambdaForm(..)?

Yes, that is how I see it.  The fast path is a racy non-volatile read of a safely-published structure.

(If safe publication via arrays were broken, java.lang.String would be broken.  But the JMM is carefully designed to support safe publication of array elements, and through array elements.)

— John

More information about the core-libs-dev mailing list