From owner-freebsd-smp Mon Jul 3 20:41:21 2000 Delivered-To: freebsd-smp@freebsd.org Received: from berserker.bsdi.com (berserker.twistedbit.com [199.79.183.1]) by hub.freebsd.org (Postfix) with ESMTP id 4AF8E37B5E7 for ; Mon, 3 Jul 2000 20:41:17 -0700 (PDT) (envelope-from cp@berserker.bsdi.com) Received: from berserker.bsdi.com (cp@localhost [127.0.0.1]) by berserker.bsdi.com (8.9.3/8.9.3) with ESMTP id VAA01866; Mon, 3 Jul 2000 21:40:57 -0600 (MDT) Message-Id: <200007040340.VAA01866@berserker.bsdi.com> To: Greg Lehey Cc: Daniel Eischen , Jason Evans , Luoqi Chen , smp@freebsd.org Subject: Re: SMP meeting summary From: Chuck Paterson Date: Mon, 03 Jul 2000 21:40:57 -0600 Sender: owner-freebsd-smp@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org } }Maybe. I need to let this go through my head. Just because we found }it to be the right idea at Tandem doesn't mean it's the right idea }here. I've never been able to understand the advantages of }conditional variables, which may be my viewpoint, or it may be some }basic lack of understanding. } This is how I think of it: Mutexs are a synchronization mechanism optimized such that they have to be acquired and then released by the same process. Tsleep, conditional variables are a mechanism that is optimized such that it is used for one process to wait for an event posted by another process. A general purpose semaphore could be used for either one. The current use of lock manager locks with bufs is an example of this. Mutexs map well into what hardware such as Intel or Sparc can natively support. Any of the other mechanism are likely to be twice as expensive, requiring two low level locked operations per high level locked operation. This isn't always true as read/writer locks can be as cheap as a mutex for the case where there is a single reader or writer. But once again this is the case where the same process is acquiring and releasing the resource without action from another process. It may well be that Tandem hardware made general purpose semaphores as cheap as mutexs. This could be because there was support for a higher level operation or just a few (or one as in the case of Cray) synchronization registers. In either case software can use general purpose semaphores for everything and not screw with all these hybrids. Chuck To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-smp" in the body of the message