[lkml]   [2002]   [Jun]   [12]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
    SubjectRe: [PATCH] Futex Asynchronous Interface
    In message <> you write:
    > What are the plans on how to deal with a waiter when the lock holder
    > dies abnormally?
    > What about sending a signal (SIGTRAP or SIGLOST), returning -1 and
    > setting errno to a reasonable value (EIO?)

    This is becoming an FAQ:

    No, you can't. These locks are fast because they don't go through the
    kernel in the contented case -> the kernel doesn't know who has it.

    You can deal with this in userspace, though, if you make certain
    assumptions. Have a daemon which say, polls the futexes every second
    and when a futex is taken for two seconds in a row, tries to grab it
    itself with a 1 second timeout: if it fails it assumes the lock is
    stuck and take action (note: anyone can lock or unlock, there's no
    lock "owner" except by convention).

    This is not perfect, but neither is the fcntl lock case of "process
    dies, lock vanishes, noone gets told". And since the cleanup is
    app-specific, making the whole thing app-specific is not so crazy.

    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:26    [W:0.045 / U:8.376 seconds]
    ©2003-2016 Jasper Spaans. hosted at Digital OceanAdvertise on this site