By: Konrad Schwarz (no.spam.delete@this.no.spam), December 7, 2014 2:28 pm
Room: Moderated Discussions
Gabriele Svelto (gabriele.svelto.delete@this.gmail.com) on December 5, 2014 10:38 am wrote:
> Konrad Schwarz (no.spam.delete@this.no.spam) on December 5, 2014 3:37 am wrote:
> No, a mutex needs to ensure that whatever happens within the lock/unlock pair is self-contained
> WRT other threads which means that - especially on weakly ordered architectures - you will
> need heavy-weight memory barriers both during acquisition (so that no memory operation after
> it is executed before the instruction that acquires the lock) and when unlocking (so that
> all previous memory operations are globally visible before the lock is released).
Atomic operations with acquire/release semantics are in the same boat, of course.
> Konrad Schwarz (no.spam.delete@this.no.spam) on December 5, 2014 3:37 am wrote:
> No, a mutex needs to ensure that whatever happens within the lock/unlock pair is self-contained
> WRT other threads which means that - especially on weakly ordered architectures - you will
> need heavy-weight memory barriers both during acquisition (so that no memory operation after
> it is executed before the instruction that acquires the lock) and when unlocking (so that
> all previous memory operations are globally visible before the lock is released).
Atomic operations with acquire/release semantics are in the same boat, of course.