XNERV JOURNAL
God's in his heaven. All's right with the world.
Category
1 post
volatile volatile使得代码每次在读写volatile变量时都需要从内存读写,而不能使用寄存器中缓存的值。并且也禁止编译器对volatible做编译优化。volatile本身并不是用于线程同步,也不保证原子读写(例如volat…