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

Manfred Spraul (manfred@colorfullife.com)
Sun, 13 Jan 2002 13:55:33 +0100


Matthew Kirkwood wrote:
>
>
> Yep, that'd be fine. However, you then lose the neatness
> of "lock==file descriptor", and need something other than
> read/write for down/up.
>
pread(), use the file pointer.

>
> I guess the alternative is to store them in a hash table
> or tree but I don't know what that would do to the
> contended case.
>
I'd start with file descriptor+pread(), and then check how much faster
your could get without any protection at all (i.e. just trust user
space). If the difference is small, then use the file descriptor.

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