Synchronizing auxiliary mutex data

Torvald Riegel triegel@redhat.com
Tue Jun 20 17:40:00 GMT 2017


On Tue, 2017-06-20 at 17:02 +0200, Andreas Schwab wrote:
> On Jun 19 2017, Torvald Riegel <triegel@redhat.com> wrote:
> 
> > __owner accesses need to use atomics (which they don't, currently).
> 
> Does that mean mutexes are broken right now?

No, I would not characterize it like that.  Technically, this is
undefined behavior because the program is not data-race-free.  However,
all we'd need for the accesses to __owner are relaxed MO atomics, so on
the architectures we care about it's sufficient if the compiler just
does the access once without splitting it up into different parts; we
can assume that it is very likely that it will do that in practice.
We should avoid the undefined behavior eventually, but it is nothing
that I'd be really worried right now.




More information about the Libc-alpha mailing list