public inbox for libc-ports@sourceware.org
 help / color / mirror / Atom feed
* PI mutex support for pthread_cond_* now in nptl
@ 2013-02-18 10:56 Siddhesh Poyarekar
  2013-02-18 23:50 ` Joseph S. Myers
                   ` (2 more replies)
  0 siblings, 3 replies; 18+ messages in thread
From: Siddhesh Poyarekar @ 2013-02-18 10:56 UTC (permalink / raw)
  To: libc-ports; +Cc: libc-alpha

Hi arch-maintainers!

The x86 assembly code for pthread_cond_* functions has, since some
time now, been capable of utilizing PI mutexes (using
PTHREAD_PRIO_INHERIT when initializing a mutex) optimally by using the
FUTEX_WAIT_REQUEUE_PI and its companion FUTEX_CMP_REQUEUE_PI to
requeue waiters woken on pthread_cond_broadcast to the PI mutex while
waking just one child, hence avoiding the thundering herd effect.
This code is now available on the default C implementation in master,
which is used by most non-x86 architectures in glibc.

To allow your architecture to use this, you need to define the
following:

- lll_futex_wait_requeue_pi macro to call the FUTEX_WAIT_REQUEUE_PI
  operation in a futex syscall.

- lll_futex_timed_wait_requeue_pi, which is the timed equivalent of
  the above.

- lll_futex_cmp_requeue_pi to call FUTEX_CMP_REQUEUE_PI.

I have committed implementations for s390 and powerpc, which can be
used as examples for implementation on other architectures.


Siddhesh

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

end of thread, other threads:[~2013-02-22  4:11 UTC | newest]

Thread overview: 18+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-02-18 10:56 PI mutex support for pthread_cond_* now in nptl Siddhesh Poyarekar
2013-02-18 23:50 ` Joseph S. Myers
2013-02-19  0:50   ` Joseph S. Myers
2013-02-19 16:42 ` Richard Henderson
2013-02-19 16:49   ` Siddhesh Poyarekar
2013-02-19 17:18   ` Joseph S. Myers
2013-02-19 17:21     ` Siddhesh Poyarekar
2013-02-19 20:06     ` Torvald Riegel
2013-02-20 18:13       ` Steven Munroe
2013-02-20 20:25         ` Torvald Riegel
2013-02-20 22:04           ` Roland McGrath
2013-02-20 22:41           ` Steven Munroe
2013-02-21  4:32           ` Siddhesh Poyarekar
     [not found]     ` <1361304381.581.80.camel__6928.53579898856$1361304432$gmane$org@triegel.csb>
2013-02-22  4:11       ` Andi Kleen
     [not found] ` <5123AB55.2070100__45742.2411222526$1361292204$gmane$org@twiddle.net>
2013-02-19 17:01   ` Andreas Schwab
2013-02-19 17:18     ` Siddhesh Poyarekar
2013-02-19 17:39       ` Andreas Schwab
2013-02-19 17:52         ` Siddhesh Poyarekar

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).