From owner-freebsd-smp Mon Jun 26 13:22:49 2000 Delivered-To: freebsd-smp@freebsd.org Received: from anchor-post-30.mail.demon.net (anchor-post-30.mail.demon.net [194.217.242.88]) by hub.freebsd.org (Postfix) with ESMTP id 6691937BC4B for ; Mon, 26 Jun 2000 13:22:41 -0700 (PDT) (envelope-from dfr@nlsystems.com) Received: from nlsys.demon.co.uk ([158.152.125.33] helo=herring.nlsystems.com) by anchor-post-30.mail.demon.net with esmtp (Exim 2.12 #1) id 136fOk-000CjP-0U; Mon, 26 Jun 2000 21:22:26 +0100 Received: from salmon.nlsystems.com (salmon.nlsystems.com [10.0.0.3]) by herring.nlsystems.com (8.9.3/8.8.8) with ESMTP id VAA97005; Mon, 26 Jun 2000 21:22:37 +0100 (BST) (envelope-from dfr@nlsystems.com) Date: Mon, 26 Jun 2000 21:26:33 +0100 (BST) From: Doug Rabson To: Luoqi Chen Cc: jasone@canonware.com, smp@freebsd.org Subject: Re: SMP meeting summary In-Reply-To: <200006261646.e5QGkUS06290@lor.watermarkgroup.com> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-smp@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org On Mon, 26 Jun 2000, Luoqi Chen wrote: > > Compared with the use of tsleep(), mutexes have a number of > > advantages: > > > > - Each mutex has its own wait (sleep) queue. When a process releases > > a mutex, it automatically schedules the next process waiting on the > > queue. This is more efficient than searching a possibly very long, > > linear sleep queue. It also avoids the flooding when multiple > > processes get scheduled, and most of them have to go back to sleep > > again. > > > What about processes of different priorities blocking for the same mutex? > Would you do a linear search on the queue? or have the queue sorted by > priority? or a FIFO queue is good enough? The BSD/OS mutex has the queue sorted by priority. -- Doug Rabson Mail: dfr@nlsystems.com Nonlinear Systems Ltd. Phone: +44 20 8442 9037 To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-smp" in the body of the message