Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 24 Sep 2000 11:26:31 +0100
From:      Brian Somers <brian@Awfulhak.org>
To:        Greg Lehey <grog@wantadilla.lemis.com>
Cc:        Chuck Paterson <cp@bsdi.com>, Archie Cobbs <archie@whistle.com>, Brian Somers <brian@Awfulhak.org>, Joerg Micheel <joerg@cs.waikato.ac.nz>, Matthew Jacob <mjacob@feral.com>, Frank Mayhar <frank@exit.com>, John Baldwin <jhb@pike.osd.bsdi.com>, Mark Murray <markm@freebsd.org>, FreeBSD-arch@freebsd.org, brian@Awfulhak.org
Subject:   Re: Mutexes and semaphores (was: cvs commit: src/sys/conf files src/sys/sys random.h src/sys/dev/randomdev hash.c hash.h harvest.c randomdev.c yarrow.c yarro) 
Message-ID:  <200009241026.e8OAQVx26206@hak.lan.Awfulhak.org>
In-Reply-To: Message from Greg Lehey <grog@wantadilla.lemis.com>  of "Sun, 24 Sep 2000 15:42:16 %2B0930." <20000924154216.D512@wantadilla.lemis.com> 

next in thread | previous in thread | raw e-mail | index | archive | help
> 1.  Because "mutexes" (I really hate this term; I wish I could find a
>     better one) only have an implied count of one, they can also have
>     the concept of an owner, which we use.
> 
> 2.  Because the mutex has an owner, only the owner can release it.
> 
> 3.  The mutex can also be "recursive" (it's really iterative, I
>     suppose): the owner can take it several times.  The only reason
>     for this appears to be sloppy coding, but in the short term I
>     think we're agreed that we can't dispose of that.

I agree - the idea of recursive mutices evil and should go, but the 
idea of an owner should not.  It's nice to be able to write code that 
KASSERTs that it already owns a given mutex.

> Greg
> --
> Finger grog@lemis.com for PGP public key
> See complete headers for address and phone numbers

-- 
Brian <brian@Awfulhak.org>                        <brian@[uk.]FreeBSD.org>
      <http://www.Awfulhak.org>;                   <brian@[uk.]OpenBSD.org>
Don't _EVER_ lose your sense of humour !




To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-arch" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200009241026.e8OAQVx26206>