I wish all qualifiers were revisited with an eye for simplification

Simen Kjærås simen.kjaras at gmail.com
Fri Aug 14 06:06:27 UTC 2020

On Thursday, 13 August 2020 at 19:22:29 UTC, IGotD- wrote:
> Shouldn't shared just be a relaxation in compiler checks so 
> that any data that has the "shared" qualifier is allowed to be 
> shared between threads. This is pretty much what __gshared is 
> about.

It should help the programmer write bug-free code, which 
__gshared does not. A panacea would be great, but more 
realistically we should disallow reading, writing and calling 
non-shared methods on shared data in @safe code. This limits the 
number of places where races can exist, but still (sadly) 
requires the programmer to know what he's doing when he writes 
shared code.


More information about the Digitalmars-d mailing list