阅读背景:

为什么一个点对volatile的指针,像“volatile int * p”一样有用?

来源:互联网 

volatile is to tell the compiler not to optimize the reference, so that every read/write does not use the value stored in register but does a real memory access. I can understand it is useful for some ordinary variable, but don't understand how is to tell the compiler not to optimiz




你的当前访问异常,请进行认证后继续阅读剩余内容。

分享到: