lkml.org 
[lkml]   [2006]   [Feb]   [16]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [patch 0/6] lightweight robust futexes: -V3 - Why in userspace?

* Esben Nielsen <simlo@phys.au.dk> wrote:

> As I understand the protocol the userspace task writes it's pid into
> the lock atomically when locking it and erases it atomically when it
> leaves the lock. If it is killed inbetween the pid is still there. Now
> if another task comes along it reads the pid, sets the wait flag and
> goes into the kernel. The kernel will now be able to see that the pid
> is no longer valid and therefore the owner must be dead.

this is racy - we cannot know whether the PID wrapped around.

nor does this method offer any solution for the case where there are
already waiters pending: they might be hung forever. With our solution
one of those waiters gets woken up and notice that the lock is dead.
(and in the unlikely even of that thread dying too while trying to
recover the data, the kernel will do yet another wakeup, of the next
waiter.)

Ingo
-
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: 2006-02-16 23:40    [W:0.049 / U:1.596 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site