Page 1 of 1

C++ Atomics implemented?

Posted: Mon Jan 27, 2020 12:54 pm
by raldone01
Hy,
Is the <atomic> header usable and performant or do I have to use <stdatomic.h>.
If <atomic> is not available is there some documentation with examples for <stdatomic.h>? I have already understood what all the different memory orders do.

Re: C++ Atomics implemented?

Posted: Wed Jan 29, 2020 4:56 am
by ESP_Angus
C++ atomic should work for all types up to but not including 64-bit wide types.

The libstdc++ implementation uses stdatomic.h internally, so anything that works with stdatomic.h should work with STL atomics.