Is core.internal.atomic.atomicFetchAdd implementation really lock free?

Johan j at j.nl
Mon Dec 5 11:57:29 UTC 2022


claptrap, Max,

Keep in mind that D is not "portable assembly", neither is C or 
C++. The druntime library follows (afaict) that logic everywhere.
The documentation of atomicFetchAdd could be more clear and 
explain "lock free", because that does not have a clear meaning 
in D language context.

If you want the guarantee that the machine code contains specific 
instructions, you _have_ to write assembly instructions yourself 
(which you can do in D as in C and C++).

regards,
   Johan



More information about the Digitalmars-d mailing list