Re: [RFC/PATCH] FUSYN Realtime & robust mutexes for Linux, v2.3.1

From: Rusty Russell
Date: Thu Aug 05 2004 - 06:49:23 EST


On Thu, 2004-08-05 at 17:37, Ulrich Drepper wrote:
> Andrew Morton wrote:
> > Passing the lock to a non-rt task when there's an rt-task waiting for it
> > seems pretty poor form, too.
>
> No no, that's not what is wanted. Robust mutexes are a special kind of
> mutex and not related to rt issues. Lockers of robust mutexes have to
> register with the kernel (i.e., the locking must actually be performed
> by the kernel) so that in case the thread goes away or the entire
> process dies, the mutex is unlocked and other waiters (other threads, in
> the same or other processes) can get the lock.

I don't think this is neccessarily true: I think that platforms with
64-bit compare-and-exchange can do the whole thing in userspace. They
would set the mutex and stamp in the thread ID simultanously, allowing
for "dead thread" detection (ie. I didn't get the lock, and it's a
robust mutex: check the holder is still alive).

W/o 64-bit compare-and-exchange a 100% robust solution may not be
possible though.

Thoughts?
Rusty.
--
Anyone who quotes me in their signature is an idiot -- Rusty Russell

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/