Ryonald Teofilo
Sep 29, 2023

--

Hey Paul, although most if not all platforms have atomic reads and writes for built-in types, I was referring to ISO C++ which provides no guarantee on the atomicity of reads and writes unless the variable is declared a "std::atomic".

The instruction set may update the memory atomically, but nothing guarantees that the compiler use it in a specific way, unless you force it to.

Nice article btw :)

--

--

Ryonald Teofilo
Ryonald Teofilo

Written by Ryonald Teofilo

Sharing my thoughts on programming, one debug break at a time <ryonaldteofilo.github.io>

Responses (1)