Re: [PATCH][RFC] Lightweight user-level semaphores

Matthew Kirkwood (matthew@hairy.beasts.org)
Fri, 11 Jan 2002 16:15:15 +0000 (GMT)


On Fri, 11 Jan 2002, Manfred Spraul wrote:

> > Actually, the more I look at Linus's original idea, the more
> > sense it seems to make (and the more I regret scrapping my
> > almost-complete implementation of it for the fd idea :)
>
> Do you have a plan how to implement the no-contention case entirely in
> userspace?
> That would make them really fast, not just saving 50 or 100 cycles
> through a special syscall and bypassing VFS.

Yep, it was really easy. Following Linus' design[0]
it was a really easy hack[1].

I'd like these things to be really easily shareable,
and that's harder to do when you need to communicate
a mapped area and a file descriptor.

But without an obvious handle, it's hard to collect
unreferenced locks.

Rusty's idea is nice (though I think it'd be better
with a filesystem than a device, so you can share
names rather than file descriptors) but the page per
lock seems like rather too much overhead.

Matthew.

[0] http://lwn.net/2001/0419/a/lt-semaphores.php3
[1] Kernel patch: http://hairy.beasts.org/usersem-2.4.17.diff
(I have a more complete patch on a machine which isn't up
right now.)
Userspace bit: http://hairy.beasts.org/ust.tar.gz

-
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/