Is core.internal.atomic.atomicFetchAdd implementation really lock free?
H. S. Teoh
hsteoh at qfbox.info
Wed Nov 30 00:12:23 UTC 2022
On Wed, Nov 30, 2022 at 12:04:22AM +0000, mw via Digitalmars-d wrote:
> According to the doc:
>
> https://dlang.org/library/core/atomic/atomic_fetch_add.html
>
> Atomically adds mod to the value referenced by val and returns the
> value val held previously. This operation is both lock-free and
> atomic.
[...]
Hmm, that's weird that the docs would say that. I've always been under
the impression that core.atomic ops use locks to achieve atomicity.
T
--
Which is worse: ignorance or apathy? Who knows? Who cares? -- Erich Schubert
More information about the Digitalmars-d
mailing list