linux-rt-users.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Pthread Condition Variables and Priority Inversion
@ 2012-09-05 23:17 Darren Hart
  2012-09-05 23:59 ` Frank Rowand
  0 siblings, 1 reply; 6+ messages in thread
From: Darren Hart @ 2012-09-05 23:17 UTC (permalink / raw)
  To: Michael Kerrisk; +Cc: Frank Rowand, Thomas Gleixner, linux-rt-users, Jan Kiszka

Hi Michael,

I've tried many times over the last several years to get proper priority
inheritance support for pthread condition variables added to glibc.
Unfortunately, I haven't convinced the powers that be to incorporate the
proposed fixes. Since the failure scenario involves an opaque type and
is rather non-intuitive, it was suggested (thanks Frank) that I attempt
to at least document the behavior. The goal is to discourage the use of
condition variables in real-time applications as they have the potential
for catastrophic system failure which could lead to loss of life - at
least until such time as support is incorporated into the C library.

I understand PTHREAD_COND_TIMEDWAIT(3P) is not Linux specific. I wonder
if you could recommend an appropriate document for the following blurb:

While the Linux kernel, since 2.6.31, supports requeueing of
priority-inheritance (PI) aware mutexes via the FUTEX_WAIT_REQUEUE_PI
and FUTEX_CMP_REQUEUE_PI futex operations, the glibc implementation does
not yet take full advantage of this. Specifically, the condvar internal
data lock remains a non-PI aware mutex, regardless of the type of the
pthread_mutex associated with the condvar. This can lead to an unbounded
priority inversion on the internal data lock even when associating a PI
aware pthread_mutex with a condvar during a pthread_cond*_wait
operation. For this reason, it is not recommended to rely on priority
inheritance when using pthread condition variables.

-- 
Darren Hart
Intel Open Source Technology Center
Yocto Project - Technical Lead - Linux Kernel

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

end of thread, other threads:[~2012-09-14 19:29 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-09-05 23:17 Pthread Condition Variables and Priority Inversion Darren Hart
2012-09-05 23:59 ` Frank Rowand
2012-09-06  0:10   ` Darren Hart
2012-09-14  2:16     ` Carol Wong
2012-09-14 17:10       ` Jan Kiszka
2012-09-14 19:28         ` Darren Hart

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 NNTP newsgroup(s).