Oh, my GoD! Goroutines on D
Jin
nin-jin at ya.ru
Wed Jan 8 11:33:43 UTC 2025
On Wednesday, 8 January 2025 at 10:16:58 UTC, claptrap wrote:
> Technically it is lock free but not wait free. No thread can
> actually hold it like a regular lock, the CAS either succeeds
> or of fails in one go, so you are always guaranteed at least
> one thread will progress.
For wait-free in general and cyclic buffers in particular, it is
important that operations are ordered (first buffer operations,
then offset updates). CAS does not do anything useful in this
case, as it always succeeds (only one thread writes to offset),
but other operations can be rearranged.
More information about the Digitalmars-d
mailing list