[lkml]   [2002]   [Mar]   [17]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
    SubjectRe: [PATCH] Futexes IV (Fast Lightweight Userspace Semaphores)
    On Sat, 16 Mar 2002 12:23:26 +0100
    Martin Wirth <> wrote:
    > Rusty Russell wrote:
    > >The solution I was referring to before, using full semaphores, would
    > >look like so:


    > In principle that works. But one of things that's less nice with
    > pthread_cond_wait is
    > that you sometimes have a (most of the time) unnecessary schedule
    > ping-pong, and with the
    > approach above you always have this (due to ack).

    Only vs. pthread_cond_broadcast. And if you're using that you probably
    have some other performance issues anyway?

    > And secondly if
    > futex_up(&f, N) for N > 1
    > relies on the chained wakeup in the kernels futex_up routine the
    > broadcast may take a while to
    > complete (the lowest priority waiter penalizes all others queued behind
    > him). A semaphore simply is no full replacement for a waitqueue with
    > wake_all.

    Yes, we could have a "wake N" variant, which would be more efficient here.

    Hope that clarifies,
    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
    More majordomo info at
    Please read the FAQ at

     \ /
      Last update: 2005-03-22 13:25    [W:0.021 / U:40.872 seconds]
    ©2003-2017 Jasper Spaans. hosted at Digital OceanAdvertise on this site