shared - i need it to be useful

Manu turkeyman at gmail.com
Mon Oct 15 19:39:05 UTC 2018


On Mon, Oct 15, 2018 at 12:15 PM Peter Alexander via Digitalmars-d
<digitalmars-d at puremagic.com> wrote:
>
> On Monday, 15 October 2018 at 18:46:45 UTC, Manu wrote:
> > 2. object may have shared methods; such methods CAN be called on
> > shared instances. such methods may internally implement
> > synchronisation to perform their function. perhaps methods of a
> > lock-free queue structure for instance, or operator overloads on
> > `Atomic!int`, etc.
>
> Just checking my understanding: are you saying here that shared
> methods can effectively do anything and the burden of correctness
> is on the author? Or do you still have to cast the shared away
> first?

Just to be clear:

> are you saying here that shared methods can effectively do anything

No, quite the opposite. I am saying that shared objects have neither
read nor write access to members. Shared means "no read or write
access". You can only call shared methods.


More information about the Digitalmars-d mailing list