From owner-freebsd-arch@FreeBSD.ORG Fri Nov 23 08:24:59 2007 Return-Path: Delivered-To: arch@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id AE8AB16A420 for ; Fri, 23 Nov 2007 08:24:59 +0000 (UTC) (envelope-from bright@elvis.mu.org) Received: from elvis.mu.org (elvis.mu.org [192.203.228.196]) by mx1.freebsd.org (Postfix) with ESMTP id 96A5213C45B for ; Fri, 23 Nov 2007 08:24:59 +0000 (UTC) (envelope-from bright@elvis.mu.org) Received: by elvis.mu.org (Postfix, from userid 1192) id 7EEC51A4D7C; Fri, 23 Nov 2007 00:24:59 -0800 (PST) Date: Fri, 23 Nov 2007 00:24:59 -0800 From: Alfred Perlstein To: dima <_pppp@mail.ru> Message-ID: <20071123082459.GO44563@elvis.mu.org> References: <20071122195823.GH44563@elvis.mu.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.4.2.3i Cc: arch@freebsd.org Subject: Re: Re[2]: rwlocks, correctness over speed. X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Nov 2007 08:24:59 -0000 * dima <_pppp@mail.ru> [071122 19:20] wrote: > > The current design is probably fast, but incorrect. Writers will be starved even if we deny recursive read-locks. There are 2 ways to fix that: > 1. Forbid recursive read-locks *and* add a flag which would mean "a writer is waiting" (and prohibit future read-lock acquisition). Yes, this would be done later. > 2. Allow recursive read-locks, add the same flag, and add an accounting of all the current readers (so, only recursive read-lock acquisitions would be accepted if a writer is waiting). Probably not going to happen as the extra bookkeeping is supposedly cost prohibitive. -Alfred