From owner-cvs-src@FreeBSD.ORG Sat Nov 6 12:15:22 2004 Return-Path: Delivered-To: cvs-src@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 3942F16A4CE; Sat, 6 Nov 2004 12:15:22 +0000 (GMT) Received: from elvis.mu.org (elvis.mu.org [192.203.228.196]) by mx1.FreeBSD.org (Postfix) with ESMTP id 2522143D45; Sat, 6 Nov 2004 12:15:22 +0000 (GMT) (envelope-from bright@elvis.mu.org) Received: by elvis.mu.org (Postfix, from userid 1192) id 1D3B95CA1A; Sat, 6 Nov 2004 04:15:22 -0800 (PST) Date: Sat, 6 Nov 2004 04:15:22 -0800 From: Alfred Perlstein To: David Xu Message-ID: <20041106121522.GE24892@elvis.mu.org> References: <200410311932.i9VJWvmo058193@repoman.freebsd.org> <20041101045331.GP16728@cs.rice.edu> <20041101105113.GS24892@elvis.mu.org> <200411011441.33067.jhb@FreeBSD.org> <20041106062955.GA1986@VARK.MIT.EDU> <418C844E.3030403@freebsd.org> <20041106081147.GA1419@VARK.MIT.EDU> <418C88C5.9010803@freebsd.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <418C88C5.9010803@freebsd.org> User-Agent: Mutt/1.4.2.1i cc: src-committers@freebsd.org cc: John Baldwin cc: Alan Cox cc: cvs-src@freebsd.org cc: cvs-all@freebsd.org cc: David Schultz Subject: Re: cvs commit: src/sys/vm vm_zeroidle.c X-BeenThere: cvs-src@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: CVS commit messages for the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 06 Nov 2004 12:15:22 -0000 * David Xu [041106 00:18] wrote: > David Schultz wrote: > > >On Sat, Nov 06, 2004, David Xu wrote: > >[...] > > > > > >>It is legal to call cv_signal() without a locked mutex. > >> > >> > > > >Not according to the manpage or the comments in the code. > >What you say is true about pthreads, but pthreads is broken > >in this respect. > > > > > > > > > I don't think it is broken, calling cv_signal with mutex locked > just introduce ping-pong problem. Being able to rely on an external mutex will effectively halve the number of mutex operations needed on CVs. It seems to make sense to enforce that the associated mutex is held. The external mutex should be dropped as soon as possible, and that means it'll only add the time of a couple of more cycles to the race for contesting on the external mutex. -- - Alfred Perlstein - Research Engineering Development Inc. - email: bright@mu.org cell: 408-480-4684