Mallocator and 'shared'

Kagamin via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Tue Feb 14 09:38:10 PST 2017


On Tuesday, 14 February 2017 at 10:52:37 UTC, Johannes Pfau wrote:
> But if the interrupt accesses a variable and a normal function 
> accesses the variable as well, the access needs to be 
> 'volatile' (not cached into a register by the compiler; not 
> closely related to this discussion) and atomic, as the 
> interrupt might occur in between multiple partial writes. So 
> the variable should be shared, although there's no 
> multithreading (in the usual sense).

Single publishing (loggers, singletons) doesn't need atomic load: 
https://forum.dlang.org/post/ozssiniwkaghcjvrlhjq@forum.dlang.org


More information about the Digitalmars-d-learn mailing list