Re:A fast multi-producer, multi-consumer lock-free concurren...
by gpderetta on Monday December 05, 2016 @07:05AM
(#13104871)
> 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.
... 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