摘要:
先看看测试代码// cas.c#include <stdio.h>#include <pthread.h>#include <stdlib.h>static int count = 0;void *test_func(void *arg){ int i=0; for(i=0;i<100000;++i){ __sync_fetch_and_add(&count,1); } return NULL;}int main(int argc, const char *argv[]){ pthread_t ... 阅读全文
posted @ 2012-07-29 12:03 feisky 阅读(1553) 评论(0) 推荐(0) 编辑