satori-com / tcpkali

Fast multi-core TCP and WebSockets load generator.
Other
2.29k stars 199 forks source link

Consider using __atomic* builtins instead of __sync* ones: the first support 64-bit atomics on all platforms #80

Open barracuda156 opened 1 month ago

barracuda156 commented 1 month ago

src/tcpkali_atomic.h uses old __sync* built-ins, which only support 32-bit atomics on 32-bit platforms, and then we get:

#warning \
    "This compiler does not have 64-bit compare_and_swap, results might be broken"

Instead, if the code will be changed to use __atomic* built-ins (which is what gcc upstream recommends), 64-bit atomics will be available on all platforms (32-bit ones may need explicit linking to libatomic).