On Monday, 15 October 2018 at 19:14:58 UTC, Peter Alexander 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?
Well `this` is still shared so you would be prevented from doing
anything non-atomically or lock cast away shared, but that will
be enforced by the type system. So the burden of correctness is
on the author, but the complier enforces correct behaviour.