This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [committed] Use __kernel_cmpxchg for __sync_lock_release


On 7/18/2014 7:28 AM, Mikael Pettersson wrote:
John David Anglin writes:
  > Because the atomic sync functions in config/pa/linux-atomic.c are not
  > lock free, we need to use
  > __kernel_cmpxchg for the __sync_lock_release.  This was found in
  > glibc's pthread_spin_unlock
  > implementation.
  >
  > Tested on hppa-unknown-linux-gnu.  Committed to trunk.

It seems to me that ARM's linux-atomic.c has the same problem.
CC:ing some ARM folks for clarification.
It might.  However, the issue is very subtle and may be parisc specific.

Carlos O'Donnel and I had a long discussion about it and couldn't come
to a clear understanding as to how the race occurs.  However, without
changing the release used in glibc for the pthread_spin_unlock operation,
the spin lock tests in the kyotocabinet testsuite would consistently fail.

Dave

--
John David Anglin    dave.anglin@bell.net


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]