shared - no read/write access

Manu turkeyman at gmail.com
Thu Mar 21 20:50:09 UTC 2019


On Thu, Mar 21, 2019 at 12:05 PM Kagamin via Digitalmars-d
<digitalmars-d at puremagic.com> wrote:
>
> On Wednesday, 20 March 2019 at 20:15:23 UTC, Manu wrote:
> > So, just to be clear, you favour shared being broken and
> > meaningless
> > to actually meaning something and being useful?
>
> Its meaning is to provide guarantee that thread-local data
> doesn't have threading issues and I posted the proof of its
> usefulness.

But that's now what `shared` does... it allows (guarantees even) many
threads mutate the same data at random with no protections.
By inhibiting read/write access, you force the user to obtain a lock
(or other synchronisation method) in order to access the shared data.
Without that, the path of least resistance is to just access the data,
and that's a race 100% of the time, by definition (because it's
`shared`).


More information about the Digitalmars-d mailing list