From: Jakub Jelinek <jakub@redhat.com>
To: Sebastien Dugue <sebastien.dugue@bull.net>
Cc: Arjan van de Ven <arjan@infradead.org>,
Ingo Molnar <mingo@redhat.com>,
Atsushi Nemoto <anemo@mba.ocn.ne.jp>,
Ulrich Drepper <drepper@redhat.com>,
linux-kernel@vger.kernel.org,
Pierre PEIFFER <pierre.peiffer@bull.net>
Subject: Re: NPTL mutex and the scheduling priority
Date: Wed, 14 Jun 2006 09:28:56 -0400 [thread overview]
Message-ID: <20060614132856.GA3115@devserv.devel.redhat.com> (raw)
In-Reply-To: <1150291180.3835.59.camel@frecb000686>
On Wed, Jun 14, 2006 at 03:19:40PM +0200, S?bastien Dugu? wrote:
> > FUTEX_REQUEUE is used by pthread_cond_signal to requeue the __data.__futex
> > onto __data.__lock.
>
> You meant FUTEX_WAKE_OP, I guess. I could not find any place still
> using FUTEX_REQUEUE in glibc 2.4.
glibc 2.4 uses FUTEX_CMP_REQUEUE, true, but both FUTEX_REQUEUE and
FUTEX_CMP_REQUEUE should behave the same in this regard (after all, they are
implemented using the same futex_requeue routine in the kernel).
FUTEX_CMP_REQUEUE is used in pthread_cond_broadcast, FUTEX_WAKE_OP is used in
pthread_cond_signal. E.g. nptl/sysdeps/pthread/pthread_cond_broadcast.c:
...
/* Wake everybody. */
pthread_mutex_t *mut = (pthread_mutex_t *) cond->__data.__mutex;
/* lll_futex_requeue returns 0 for success and non-zero
for errors. */
if (__builtin_expect (lll_futex_requeue (&cond->__data.__futex, 1,
INT_MAX, &mut->__data.__lock,
futex_val), 0))
{
/* The requeue functionality is not available. */
wake_all:
lll_futex_wake (&cond->__data.__futex, INT_MAX);
}
and nptl/sysdeps/pthread/pthread_cond_signal.c:
...
/* Wake one. */
if (! __builtin_expect (lll_futex_wake_unlock (&cond->__data.__futex, 1,
1, &cond->__data.__lock),
0))
return 0;
lll_futex_wake (&cond->__data.__futex, 1);
}
/* We are done. */
lll_mutex_unlock (cond->__data.__lock);
Jakub
next prev parent reply other threads:[~2006-06-14 13:29 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-06-12 8:10 NPTL mutex and the scheduling priority Atsushi Nemoto
2006-06-12 12:23 ` Arjan van de Ven
2006-06-12 12:44 ` Jakub Jelinek
2006-06-12 15:24 ` Sébastien Dugué
2006-06-12 16:06 ` Atsushi Nemoto
2006-09-07 8:11 ` Atsushi Nemoto
2006-09-07 8:32 ` Jakub Jelinek
2006-09-07 9:30 ` Atsushi Nemoto
2006-09-07 9:37 ` Andreas Schwab
2006-09-07 9:42 ` Atsushi Nemoto
2006-06-13 8:39 ` Pierre Peiffer
2006-06-13 8:48 ` Jakub Jelinek
2006-06-13 12:04 ` Sébastien Dugué
2006-06-13 12:56 ` Jakub Jelinek
2006-06-14 13:19 ` Sébastien Dugué
2006-06-14 13:28 ` Jakub Jelinek [this message]
2006-06-14 13:38 ` Pierre Peiffer
2006-06-15 9:28 ` Pierre Peiffer
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20060614132856.GA3115@devserv.devel.redhat.com \
--to=jakub@redhat.com \
--cc=anemo@mba.ocn.ne.jp \
--cc=arjan@infradead.org \
--cc=drepper@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@redhat.com \
--cc=pierre.peiffer@bull.net \
--cc=sebastien.dugue@bull.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox