On 14/7/20 8:05, Kagamin wrote:
On Monday, 13 July 2020 at 07:26:06 UTC, Arafel wrote:
That's exactly why what I propose is a way to *explicitly* tell the compiler about it, like @system does for safety.

With __gshared you can opt out from sharing safety, then you're back to old good C-style multithreading.

That's apples and oranges.

I do agree in principle with the idea of `shared`, I just want a way to tell the compiler that `shared` doesn't apply *within a given block*, if possible also only for some specific variables, because I have already taken care of the synchronization, that's exactly what the system tries to promote.

__gshared on the other hand is just dispensing with the `shared` system altogether and giving up the protections it offers. Furthermore it only works for global objects and static variables/members [1], so its use is limited.

[1]: https://dlang.org/spec/attribute.html#gshared
        • Re: how to a... Steven Schveighoffer via Digitalmars-d-learn
          • Re: how ... mw via Digitalmars-d-learn
            • Re:... Steven Schveighoffer via Digitalmars-d-learn
            • Re:... Jonathan M Davis via Digitalmars-d-learn
            • Re:... Arafel via Digitalmars-d-learn
            • Re:... Steven Schveighoffer via Digitalmars-d-learn
            • Re:... Arafel via Digitalmars-d-learn
            • Re:... Steven Schveighoffer via Digitalmars-d-learn
            • Re:... Arafel via Digitalmars-d-learn
            • Re:... Kagamin via Digitalmars-d-learn
            • Re:... Arafel via Digitalmars-d-learn
            • Re:... Kagamin via Digitalmars-d-learn
            • Re:... Kagamin via Digitalmars-d-learn
            • Re:... Arafel via Digitalmars-d-learn
            • Re:... Dominikus Dittes Scherkl via Digitalmars-d-learn
            • Re:... Arafel via Digitalmars-d-learn
            • Re:... Kagamin via Digitalmars-d-learn
        • Re: how to a... Kagamin via Digitalmars-d-learn
          • Re: how ... Steven Schveighoffer via Digitalmars-d-learn
  • Re: how to assign to shar... Jonathan M Davis via Digitalmars-d-learn

Reply via email to