开发者

Is accessing a variable of type sig_atomic_t with pointer atomic

I want to have a hash table where access to every element should be atomic and I don't want to use开发者_Go百科 locks. Can I use pointers to refer variables of type sig_atomic_t?


No. sig_atomic_t is for signal handlers, it doesn't do anything to make values visible to other CPU's or to impose any ordering of memory accesses. C1x and C++0x have new atomic types (<stdatomic.h> for C1x).

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜