From 4ac63a6c1abe0455f9fabff4a2865bf37d5b775e Mon Sep 17 00:00:00 2001 From: Michael Kerrisk Date: Mon, 12 Jan 2015 20:11:54 +0100 Subject: [PATCH] futex.2: Warn that FUTEX_REQUEUE should be avoided in favor of FUTEX_CMP_REQUEUE Signed-off-by: Michael Kerrisk --- man2/futex.2 | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/man2/futex.2 b/man2/futex.2 index d71c36590..580e31f3c 100644 --- a/man2/futex.2 +++ b/man2/futex.2 @@ -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