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

From: Linus Torvalds (
Date: Mon Jan 07 2002 - 17:38:45 EST

On Mon, 7 Jan 2002, Matthew Kirkwood wrote:
> >
> > Yes, I was going to just attach to the vma,
> Wouldn't that have to be an address_space, so separate maps
> of the same object will use the same count? Or (not unlikely)
> am I misunderstanding the way these structures are laid out?

I would just mke the creator be special. The guy who creates the semaphore
owns it, and if he unmaps it, it's gone.

Note that there are other, potentially cleaner solutions. In particular,
some people like the "semaphore as file descriptor" approach, and I have
to say that I think they may be right. Then you just pass the file
descriptor along as the cookie, and you can do dup()/close() etc on it.

Mind trying that approach instead? It's not all that far off from your
current setup, and it would certainly have none of the security


To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to
More majordomo info at
Please read the FAQ at

This archive was generated by hypermail 2b29 : Mon Jan 07 2002 - 21:00:37 EST