MetallicPriest
MetallicPriest

Reputation: 30765

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?

Upvotes: 1

Views: 349

Answers (1)

ninjalj
ninjalj

Reputation: 43708

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

Upvotes: 1

Related Questions