Understanding of the volatile of (1)

volatitle to solve the problem of multiple threads, invisible threads between parameters, so some a label, without volatitle when the parameter is equivalent to obtain a copy from the main memory, is to use this parameter has a copy, so this parameter will not be updated after adding volatitle, each thread will get a copy of the new parameters, the parameters of the old copy before destruction, this parameter will get the latest version, but this can not be avoided thread safety issues, not consistency of atomic

 

Guess you like

Origin www.cnblogs.com/siyuan7657/p/12587724.html