shared - i need it to be useful

Manu turkeyman at gmail.com
Mon Oct 22 19:29:40 UTC 2018


On Mon, Oct 22, 2018 at 7:10 AM Simen Kjærås via Digitalmars-d
<digitalmars-d at puremagic.com> wrote:
>
> On Monday, 22 October 2018 at 13:40:39 UTC, Timon Gehr wrote:
> > module reborked;
> > import atomic;
> >
> > void main()@safe{
> >     auto a=new Atomic!int;
> >     import std.concurrency;
> >     spawn((shared(Atomic!int)* a){ ++*a; }, a);
> >     ++a.tupleof[0];
> > }
>
> Finally! Proof that MP is impossible. On the other hand, why the
> hell is that @safe? It breaks all sorts of guarantees about
> @safety. At a minimum, that should be un- at safe.
>
> Filed in bugzilla: https://issues.dlang.org/show_bug.cgi?id=19326

Yeah, that's shockingly dangerous for all sorts of reasons!
I mean, is this really an argument to destroy my proposal, or are you
just destroying @safe in general?



More information about the Digitalmars-d mailing list