RFR: 8181085: Race condition in method resolution may produce spurious NullPointerException
    Kim Barrett 
    kim.barrett at oracle.com
       
    Sat May 27 02:45:23 UTC 2017
    
    
  
> On May 26, 2017, at 12:03 PM, Volker Simonis <volker.simonis at gmail.com> wrote:
> 
> Volatile not only prevents reordering by the compiler. It also prevents
> other, otherwise legal transformations/optimizations (like for example
> reloading a variable [1]) which have to be prevented in order to write
> correct, lock free  programs.
> 
> So I think declaring the variables involved in such algorithms volatile is
> currently still necessary.
Seems like the thing to do would be to use Atomic::load instead of a
bare reference.
    
    
More information about the jdk10-dev
mailing list