This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: Synchronizing auxiliary mutex data
On Jun 21 2017, Alexander Monakov <amonakov@ispras.ru> wrote:
> Inside LLL_MUTEX_LOCK there's an atomic operation with acquire memory ordering.
> The compiler and the hardware are responsible, together, for ensuring proper
> ordering: the compiler may not move the load of __owner up prior to that atomic
> operation, and must emit machine code that will cause the CPU to keep the
> ordering at runtime (on some architectures, e.g. ARM, this implies emitting memory
> barrier instructions, but on x86 the atomic operation will be a lock-prefixed
> memory operation, enforcing proper ordering on its own).
Does that mean that an atomic operation flushes the cpu caches?
Andreas.
--
Andreas Schwab, SUSE Labs, schwab@suse.de
GPG Key fingerprint = 0196 BAD8 1CE9 1970 F4BE 1748 E4D4 88E3 0EEA B9D7
"And now for something completely different."