mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Alan Cox <alan@lxorguk.ukuu.org.uk>
To: matthew@hairy.beasts.org (Matthew Kirkwood)
Cc: alan@lxorguk.ukuu.org.uk (Alan Cox),
	manfred@colorfullife.com (Manfred Spraul),
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH][RFC] Lightweight user-level semaphores
Date: Sun, 13 Jan 2002 15:13:30 +0000 (GMT)	[thread overview]
Message-ID: <E16PmKA-0007BS-00@the-village.bc.nu> (raw)
In-Reply-To: <Pine.LNX.4.33.0201131216230.24442-100000@sphinx.mythic-beasts.com> from "Matthew Kirkwood" at Jan 13, 2002 12:38:43 PM

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

If I have to have 2000 pages and 2000 file handles for 2000 locks I've
kind of lost interest. read/write syscalls take offsets. I can pread/pwrite
a lock in a set of locks. The only reason for using an fd I can see is so
you can poll on a lock. All the other neatness issues are wrapped in the
library support code anyway.

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

Read my old mail you need neither a hash table or a tree. You just need
the required shadow object

	offset = addr - vma->vm_start;
	offset /= sizeof(struct user_lock);
	lock = ((struct lock *)vma->vm_private_data)[offset];

Alan

  parent reply	other threads:[~2002-01-13 15:02 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-01-11 15:50 Manfred Spraul
2002-01-11 16:15 ` Matthew Kirkwood
2002-01-11 17:03   ` Alan Cox
2002-01-13 12:38     ` Matthew Kirkwood
2002-01-13 12:55       ` Manfred Spraul
2002-01-13 15:13       ` Alan Cox [this message]
2002-01-14  1:35       ` Rusty Russell
     [not found] <Pine.LNX.4.33.0201081443540.8169-100000@penguin.transmeta.com>
2002-01-09 23:23 ` Matthew Kirkwood
2002-01-11  5:55 ` Rusty Russell
2002-01-11 11:40   ` Matthew Kirkwood
  -- strict thread matches above, loose matches on Subject: below --
2002-01-07 20:05 Matthew Kirkwood
2002-01-07 20:28 ` Linus Torvalds
2002-01-07 22:03   ` Matthew Kirkwood
2002-01-07 22:38     ` Linus Torvalds
2002-01-08 13:56 ` Alan Cox

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=E16PmKA-0007BS-00@the-village.bc.nu \
    --to=alan@lxorguk.ukuu.org.uk \
    --cc=linux-kernel@vger.kernel.org \
    --cc=manfred@colorfullife.com \
    --cc=matthew@hairy.beasts.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®