volatile在多线程中的使用

 1. 为何用volatile?安全     C/C++ 中的 volatile 关键字和 const 对应,用来修饰变量,一般用于创建语言级别的 memory barrier。这是 BS 在 "The C++ Programming Language" 对 volatile 修饰词的说明:多线程 A volatile specifier is a hint to a compiler that
相关文章
相关标签/搜索