AA vs __gshared

Kagamin spam at here.lot
Fri Jul 28 04:13:13 UTC 2023


On Friday, 28 July 2023 at 03:54:53 UTC, IchorDev wrote:
> I was told that using `__gshared` is quite a bit faster at 
> runtime than using `shared`, but I also don't really know 
> anything concrete about `shared` because the spec is so 
> incredibly vague about it.

The difference between them is purely formal if you're not on an 
old gdc, where shared was synchronized like C# volatile. If the 
crashes are frequent, can you reproduce a crash with a minimal 
amount of code, start many threads and access the locked AA 
concurrently.


More information about the Digitalmars-d-learn mailing list