C++ Atomics implemented?

raldone01
Posts: 8
Joined: Thu Apr 18, 2019 9:37 pm

C++ Atomics implemented?

Postby raldone01 » Mon Jan 27, 2020 12:54 pm

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.

ESP_Angus
Posts: 2344
Joined: Sun May 08, 2016 4:11 am

Re: C++ Atomics implemented?

Postby ESP_Angus » Wed Jan 29, 2020 4:56 am

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.

Who is online

Users browsing this forum: No registered users and 175 guests