futex.2: Warn that FUTEX_REQUEUE should be avoided in favor of FUTEX_CMP_REQUEUE

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
This commit is contained in:
Michael Kerrisk 2015-01-12 20:11:54 +01:00
parent 6bac3b8517
commit 4ac63a6c1a
1 changed files with 8 additions and 2 deletions

View File

@ -429,6 +429,14 @@ has been removed from Linux 2.6.26 onward.
.TP
.BR FUTEX_REQUEUE " (since Linux 2.6.0)"
.\" Strictly speaking: from Linux 2.5.70
.\"
.\" FIXME I added this warning. Okay?
.IR "Avoid using this operation" .
It is broken (unavoidably racey) for its intended purpose.
Use
.BR FUTEX_CMP_REQUEUE
instead.
This operation was introduced in order to avoid a "thundering herd" effect
when
.B FUTEX_WAKE
@ -461,8 +469,6 @@ There was a race in the intended use of
so
.B FUTEX_CMP_REQUEUE
was introduced.
.\" FIXME should there be a statement in the description of FUTEX_REQUEUE
.\" to say that it should be avoided in favor of FUTEX_CMP_REQUEUE?
This operation is similar to
.BR FUTEX_REQUEUE ,
but first checks whether the location