On Tue, Dec 24, 2013 at 04:55:47PM +0100, Marin Ramesa wrote: > I use a recursive futex_wake(). It first scans all the futexes if > they are on the same offset and if they share the same vm_object. > If they do, recursion is used to wake a number of threads in those > futexes. The number of threads awakened is constant troughout the > same offsets and in the same objects. In this way synchronization > is possible. I don't do anything in futex_wait().
Right. Well, consider how small stacks usually are in a kernel, and you should understand why anything recursive (except if bounded) is unacceptable. Then, why a scan through vm_objects ? Why not directly find the one futex associated with a (map, address) and wake all threads waiting on it ? Also, why pass a number of threads to wake ? Why not simply choose between one or all ? -- Richard Braun