DIP 1024--Shared Atomics--Community Review Round 1

Manu turkeyman at gmail.com
Wed Oct 2 18:22:05 UTC 2019


On Wed, Oct 2, 2019 at 10:55 AM Atila Neves via Digitalmars-d
<digitalmars-d at puremagic.com> wrote:
>
> On Wednesday, 2 October 2019 at 17:21:59 UTC, Manu wrote:
> > On Wed, Oct 2, 2019 at 2:10 AM Walter Bright via Digitalmars-d
> > <digitalmars-d at puremagic.com> wrote:
> >>
> >> On 10/1/2019 11:30 PM, Manu wrote:
> >> > I'm confused, which is it, A or B? I presume B, and my prior
> >> > commentary applies.
> >>
> >> A
> >
> > In that case, I don't understand the only code shown in the
> > DIP; you show freely reading from and assigning to a shared
> > int... that should be an error, and there should be
> > atomicLoad/astomicStore in those locations?
>
> My understanding is that the compiler rewrites that code to use
> core.atomic.

I asked Walter a couple posts up whether or not that's what he meant
(A/B), and he said A:
"""
By prohibiting direct access to shared data, the user will be required
to use core.atomic and to consider the correctness of their code.
This change will require using core.atomic or equivalent functions to
read and write to shared memory objects. It will prevent unintended,
inadvertent non-use of atomic access.
"""
...which is distinctly not that.


More information about the Digitalmars-d mailing list