我理解的对volatile变量的重排序(编译器重排序和处理器重排序),主要目的是为了实现对volatile的写,Happend-Before对volatile的读
volatile
所以,按照我理解的话,并不需要像图表中那么严谨
欢迎选择我的课程,让我们一起见证您的进步~~
In the case of multi-threading, there is a synchronization problem between the thread working memory and the main memory. Volatile is only available immediately on the main memory
In the case of multi-threading, there is a synchronization problem between the thread working memory and the main memory. Volatile is only available immediately on the main memory