Bug 13713 – core.atomic should use compiler intrinsics

Status
NEW
Severity
enhancement
Priority
P4
Component
dmd
Product
D
Version
D2
Platform
Other
OS
All
Creation time
2014-11-11T12:06:41Z
Last change time
2024-12-13T18:34:21Z
Assigned to
No Owner
Creator
Martin Nowak
See also
https://issues.dlang.org/show_bug.cgi?id=15007
Moved to GitHub: dmd#18910 →

Comments

Comment #0 by code — 2014-11-11T12:06:41Z
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
THIS ISSUE HAS BEEN MOVED TO GITHUB https://github.com/dlang/dmd/issues/18910 DO NOT COMMENT HERE ANYMORE, NOBODY WILL SEE IT, THIS ISSUE HAS BEEN MOVED TO GITHUB