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 0/6][BZ #11588] pi-condvars: add priority inheritance for pthread_cond_* internal lock


On Tue, 2014-07-29 at 19:31 -0500, gratian.crisan@ni.com wrote:
> Torvald Riegel made us aware of the new POSIX changes related to condvars
> (http://austingroupbugs.net/view.php?id=609) and C++11 clarification
> (http://cplusplus.github.com/LWG/lwg-active.html#2190)
> We believe we can work on these issues in parallel and if they end up
> colliding we will fix it.

I've asked the Austin Group about the current status of #609.  It seems
they want the stronger ordering guarantees:
http://austingroupbugs.net/view.php?id=609#c2349

I have an implementation that fulfills these guarantees, but I don't
think it's possible to fully implement PI with the stronger guarantees
and the futex operations that we currently have.  The possible options
that I see are:
* Accept potential ABA issues (e.g., a lost wake-up if you do exactly
2^32 signals after a wait).
* Accept that there's no PI every 2^32 wait calls (maybe that number can
be increased somewhat, but this depends on the interleaving of
wait/signal calls I believe).
* Don't support PI on process-shared condvars, so that we can boost the
priority of waiters with per-waiter PI mutexes.  More overhead.

What would be everyone's preference?

Note that if we had 64b futexes, the first two options would both have
2^64 instead of 2^32, so both would be okay in practice.


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