volatile keyword semantic layers

1. To ensure visibility when different threads of volatile variables to be modified to operate all write operations can react immediately to the other thread, that one thread modifies the value of a variable, the value of this new variable to other volatile thread is immediately visible.
  2. Prohibition of instruction reordering optimization.

Published 59 original articles · won praise 15 · views 555

Guess you like

Origin blog.csdn.net/qq_45287265/article/details/105055578