Bug 13395 – Shared arrays must be loaded atomically

Status
REOPENED
Severity
normal
Priority
P3
Component
dmd
Product
D
Version
D2
Platform
x86
OS
Mac OS X
Creation time
2014-08-28T23:00:16Z
Last change time
2024-12-13T18:25:16Z
Assigned to
Sean Kelly
Creator
Andrei Alexandrescu
Moved to GitHub: dmd#17680 →

Comments

Comment #0 by andrei — 2014-08-28T23:00:16Z
D assumes N-bit machines support 2N-atomic loads, which is the case for all modern processors. The compiler should generate code to load and store all built-in shared slices atomically. Apparently on i64 the only way to do so is by using CMPXCHG16B (http://stackoverflow.com/questions/4099002/x86-128-bit-atomic-ops). The instruction is supported by the front-end too. Also core.atomic should support atomicLoad() for values that are 128-bit on 64-bit models.
Comment #1 by blah38621 — 2014-08-29T18:18:28Z
If someone is already going to be digging around in core.atomic, perhaps they could add intrinsic versions as well, so that the operations can be inlined and don't need to do the excessive amount of extra moving that they currently do.
Comment #2 by andrei — 2015-01-06T17:45:26Z
Comment #3 by andrei — 2015-01-07T06:23:24Z
Wait, that pull doesn't fix this. Sorry.
Comment #4 by robert.schadek — 2024-12-13T18:25:16Z
THIS ISSUE HAS BEEN MOVED TO GITHUB https://github.com/dlang/dmd/issues/17680 DO NOT COMMENT HERE ANYMORE, NOBODY WILL SEE IT, THIS ISSUE HAS BEEN MOVED TO GITHUB