3 ms·
> x86 CPUs guarantee that all reads/writes on from std::atomic are indeed, atomic ... for sizeof(T) <= 64 bits on amd64. 128 bit is technically supported (tha
by gpderetta 10y ago
> x86 CPUs guarantee that all reads/writes on from std::atomic are indeed, atomic
... for sizeof(T) <= 64 bits on amd64.
128 bit is technically supported (thanks to the availability DCAS) but stores and especially loads are significantly more expensive (as there are no native atomic 128 bit load and store), even in relaxed modes. Also, as even loads perform write cycles, they can't be used on read-only memory.
Anything larger uses, IIRC, a spinlock pool and is not lock-free.
/pedantic