Atomic vs Mutex

Jonathan JonathanILevi at gmail.com
Mon Mar 26 23:15:42 UTC 2018


Everywhere I look the advice is to avoid atomic and just mutex 
things.

Why is this `a.atomicStore(b)`(memory order is seq) less safe 
than `synchronized{a=b}`?  I get that when more operations or 
shared values are used it is appropriate to mutex the entire set 
of operations but why would I for a single set?

If the first is in fact less safe that the second then I am eager 
to learn more, could you recommend a book or paper on the subject?

Thanks!


More information about the Digitalmars-d-learn mailing list