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!
  • Atomic vs Mutex Jonathan via Digitalmars-d-learn

Reply via email to