We should reduce the overhead of atomic operations by replacing them with intrinsics. The current asm blocks cannot be inlined leading to an extra function call for cheap ops.
LDC already does it, not sure about GDC.
Comment #1 by alphaglosined — 2022-05-29T10:22:33Z
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.
Comment #2 by robert.schadek — 2024-12-13T18:34:21Z