lkml.org 
[lkml]   [2003]   [Sep]   [9]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: [PATCH] Make futex waiters take an mm or inode reference
Date
In message <Pine.LNX.4.44.0309081144390.3202-100000@home.osdl.org> you write:
> So is there any reason to really having "private.mm" AT ALL? From what I
> can tell, it is not actually ever used (all "mm" users are "current->mm"),
> so I don't see the point of incrementing a count for it either.
>
> Or did I miss something?

Yes. Firstly, you can't do "wake one" if the one you wake might be
some completely unrelated process which happens to use the same
address. Secondly, I implemented fair futexes by relying on the
return value of FUTEX_WAKE to indicate how many people were woken: you
set the futex to a magic value, call FUTEX_WAKE(1), and if it returns
1, you've "passed" the futex directly, otherwise you unlock the futex
like normal. This is surprisingly useful for implementing
"drop_futex_if_someone_is_waiting()" in cleanup threads etc.

Sorry,
Rusty.
--
Anyone who quotes me in their sig is an idiot. -- Rusty Russell.
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 13:48    [W:0.048 / U:3.780 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site