RFR(S): 8153267: nmethod's exception cache not multi-thread safe

Andrew Haley aph at redhat.com
Fri Apr 1 16:42:38 UTC 2016

On 04/01/2016 01:37 PM, Doerr, Martin wrote:

> Therefore, the nmethod's field _exception_cache needs to be volatile
> and adding new entries must be done by releasing stores. (Loading
> seems to be fine without acquire because there's an address
> dependency from the load of the cache to the usage of its contents
> which is sufficient to ensure ordering on all openjdk platforms.)

I think that's very risky.  We can't be really sure what an optimizer
might do in this area, as discussed at (very) considerable length in
concurrency forums.  memory_order_consume does this correctly in C++11
but we're not yet using C++11.  I'd use acquire and leave a note that
in future this can be replaced by memory_order_consume.


More information about the hotspot-compiler-dev mailing list