public inbox for glibc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug libc/17428] New: lll_trylock barrier semantics when lock was not acquired differ between architectures
@ 2014-09-23 17:55 triegel at redhat dot com
  2014-09-23 17:55 ` [Bug libc/17428] " triegel at redhat dot com
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: triegel at redhat dot com @ 2014-09-23 17:55 UTC (permalink / raw)
  To: glibc-bugs

https://sourceware.org/bugzilla/show_bug.cgi?id=17428

            Bug ID: 17428
           Summary: lll_trylock barrier semantics when lock was not
                    acquired differ between architectures
           Product: glibc
           Version: unspecified
            Status: NEW
          Severity: normal
          Priority: P2
         Component: libc
          Assignee: unassigned at sourceware dot org
          Reporter: triegel at redhat dot com
                CC: drepper.fsp at gmail dot com

This matters because lll_trylock is used by pthread_mutex_trylock; POSIX'
barrier requirements are impractical IMO (the wording would require full
barriers for every synchronization function), but stronger than what all arcs
provide.  C++11 only requires weak barrier semantics (memory_order_relaxed,
essentially, and spurious false negatives (ie, trylock returns that it can't
acquire the lock although it could) are allowed); these semantics make more
sense IMHO.

The default (/sysdeps/nptl/lowlevellock.h) uses
atomic_compare_and_exchange_bool_acq, which is memory_order_relaxed on the
failure path of the CAS (lock not acquired).  ARM uses the default.

Power has memory_order_acquire on the failure path.  x86/x86_64 as well,
effectively.

We should both unify this and, IMO, work towards improving POSIX' semantics.

-- 
You are receiving this mail because:
You are on the CC list for the bug.


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2014-09-23 20:58 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-09-23 17:55 [Bug libc/17428] New: lll_trylock barrier semantics when lock was not acquired differ between architectures triegel at redhat dot com
2014-09-23 17:55 ` [Bug libc/17428] " triegel at redhat dot com
2014-09-23 18:28 ` bugdal at aerifal dot cx
2014-09-23 20:58 ` triegel at redhat dot com

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).