[Issue 13713] core.atomic should use compiler intrinsics

d-bugmail at puremagic.com d-bugmail at puremagic.com
Sun May 29 10:22:33 UTC 2022


https://issues.dlang.org/show_bug.cgi?id=13713

Richard Cattermole <alphaglosined at gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |alphaglosined at gmail.com

--- Comment #1 from Richard Cattermole <alphaglosined at gmail.com> ---
GDC has intrinsic support. It also supports GCC's libatomic and a special
platform-specific mutex based upon what the hardware supports.

As of this writing, unless we can guarantee that zero function calls will be
emitted by core.atomic, it isn't fit for purpose.

With lock-free concurrent data structures, unless you are inlining the
instructions, you will almost certainly be working with old and potentially
obsolete information. It results in segfaults. There is no way around this.

As a result of this, an atomic type qualifier would be better suited which is
not syntax suger for function calls.

--


More information about the Digitalmars-d-bugs mailing list