This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc 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: [PATCH v2] PowerPC: Fix a race condition when eliding a lock


On 08/25/2015 12:47 PM, Adhemerval Zanella wrote:
> I do not know which is better, since it will tie the ELIDE_LOCK implementation
> with current internal pthread definitions.

I prefer the idea of passing an inline function to ELIDE_LOCK
and have the inline funciton do what it needs to compute is_lock_free
and then return the result. This leaves ELIDE_LOCK simpler.

However, I'm not really for one way or the other, they are roughly
all the same. The inline function is just a cleaner interface and puts
the evaluation of is_lock_free all in one place to be inlined by the
compiler.

I think the end result of Torvald's comments is that when we switch to
C11 atomics, we'll need to reference __lock with atomic_load rleaxed, so
we might as well start today.

c.


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