1.volatile is meant to be "variable" because access registers are much faster than accessing memory units, so compilers generally make optimizations to reduce access memory, but it is possible to read dirty data. When asked to declare a variable value using volatile, the system always reads the data back from its memory, even if the previous instruction has just read the data from it. Precisely, the compiler's code to access the variable is no longer optimized for the variable to which it is declared, so that it can provide stable access to the particular address; If you do not use Valatile, the compiler will optimize the statement that is declared. (Concise is: volatile keywords affect compiler compilation results, with the volatile declared variable may change at any time, and the operation of the variable, do not compile optimization to avoid errors)