gcc原子操作,AtomicIntegerT , gcc编译选项(11)
2013-11-06 10:39
369 查看
Gcc原子操作
// 原子自增操作type __sync_fetch_and_add (type *ptr, type value)
// 原子比较和交换(设置)操作
type __sync_val_compare_and_swap (type *ptr, type oldval type newval)
bool __sync_bool_compare_and_swap (type *ptr, type oldval type newval)
// 原子赋值操作
type __sync_lock_test_and_set (type *ptr, type value)
使用这些原子性操作,编译的时候需要加-march=cpu-type
无锁队列实现
http://coolshell.cn/articles/8239.html
Gcc编译选项
AtomicIntegerT ---muduo库
AtomicIntegerT的类图上面的函数都是原子操作的,也就是线程安全的函数。
相关文章推荐
- gcc原子操作,AtomicIntegerT , gcc编译选项(11)
- 关于原子操作AtomicInteger、AtomicBoolean等
- Atomic Builtins - Using the GNU Compiler Collection (GCC) GCC 提供的原子操作
- GCC原子操作(Atomic Builtins)
- java i++ 并非原子操作的解决方法——用AtomicInteger
- Java原子操作AtomicInteger的用法
- Java原子操作AtomicInteger的用法
- Java原子操作AtomicInteger的用法
- linux下gcc编译优化选项的大体操作是怎么样的?
- java.util.concurrent(JUC)的研究--》atomic原子操作--》从AtomicInteger开始
- java多线程[11]:原子操作(atomic)
- Gcc常用操作(编译选项与链接等)
- java i++ 并非原子操作的解决方法——用AtomicInteger
- 原子操作 AtomicInteger
- gcc 常用编译选项
- ubuntu 14.04 编译android4.0 出现gcc-version.sh: line 11: cc: command not found错误解决方法
- 原子变量AtomicInteger
- GCC 提供的原子操作
- Linux操作 gcc编译过程 制作静态库、动态库
- gcc编译选项