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

From: Manfred Spraul (manfred@colorfullife.com)
Date: Sun Jan 13 2002 - 07:55:33 EST


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/



This archive was generated by hypermail 2b29 : Tue Jan 15 2002 - 21:00:41 EST