From owner-freebsd-arch Sun Sep 24 3:31:38 2000 Delivered-To: freebsd-arch@freebsd.org Received: from Awfulhak.org (tun.AwfulHak.org [194.242.139.173]) by hub.freebsd.org (Postfix) with ESMTP id 97B8437B422; Sun, 24 Sep 2000 03:31:31 -0700 (PDT) Received: from hak.lan.Awfulhak.org (root@hak.lan.awfulhak.org [172.16.0.12]) by Awfulhak.org (8.11.0/8.11.0) with ESMTP id e8OASfC46009; Sun, 24 Sep 2000 11:28:41 +0100 (BST) (envelope-from brian@hak.lan.Awfulhak.org) Received: from hak.lan.Awfulhak.org (brian@localhost [127.0.0.1]) by hak.lan.Awfulhak.org (8.11.0/8.11.0) with ESMTP id e8OAQVx26206; Sun, 24 Sep 2000 11:26:31 +0100 (BST) (envelope-from brian@hak.lan.Awfulhak.org) Message-Id: <200009241026.e8OAQVx26206@hak.lan.Awfulhak.org> X-Mailer: exmh version 2.1.1 10/15/1999 To: Greg Lehey Cc: Chuck Paterson , Archie Cobbs , Brian Somers , Joerg Micheel , Matthew Jacob , Frank Mayhar , John Baldwin , Mark Murray , 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) In-Reply-To: Message from Greg Lehey of "Sun, 24 Sep 2000 15:42:16 +0930." <20000924154216.D512@wantadilla.lemis.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Sun, 24 Sep 2000 11:26:31 +0100 From: Brian Somers Sender: owner-freebsd-arch@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG > 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 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