From owner-freebsd-arch Mon Sep 11 23:35:37 2000 Delivered-To: freebsd-arch@freebsd.org Received: from feral.com (feral.com [192.67.166.1]) by hub.freebsd.org (Postfix) with ESMTP id 787B137B422; Mon, 11 Sep 2000 23:35:35 -0700 (PDT) Received: from beppo.feral.com (beppo [192.67.166.79]) by feral.com (8.9.3/8.9.3) with ESMTP id XAA13810; Mon, 11 Sep 2000 23:35:14 -0700 Date: Mon, 11 Sep 2000 23:34:55 -0700 (PDT) From: Matthew Jacob Reply-To: mjacob@feral.com To: Joerg Micheel Cc: Greg Lehey , Frank Mayhar , John Baldwin , Mark Murray , FreeBSD-arch@FreeBSD.ORG Subject: Re: 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: <20000912145255.A41113@cs.waikato.ac.nz> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-arch@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG > > At Tandem, we used semaphores exclusively (well, we had a mutex > > instruction, but it was really interrupt lockout). As far as I can > > recall, the semaphore counter was always 1, so the effect was > > identical to the current blocking "mutexes". > > I liked the model Sun chose for Solaris. They have mutex', rw_locks, > condition variables. I don't like semaphores. Mutexes are for short > locks. Condition variables are for long-term waits, they are associated > with a mutex. You can only sleep/wakeup a CV when holding the associated > with it, which prevents races. When having to sleep on a CV the kernel > would unlock the mutex and reaquire it for the running thread before > returning. It encouraged very sloppy programming. To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-arch" in the body of the message