简体   繁体   中英

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 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).

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM