From owner-cvs-all@FreeBSD.ORG Wed Feb 28 06:43:36 2007 Return-Path: X-Original-To: cvs-all@FreeBSD.org Delivered-To: cvs-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 52F8216A404; Wed, 28 Feb 2007 06:43:36 +0000 (UTC) (envelope-from grog@lemis.com) Received: from ext-gw.lemis.com (ext-gw.lemis.com [150.101.14.10]) by mx1.freebsd.org (Postfix) with ESMTP id DFECB13C474; Wed, 28 Feb 2007 06:43:35 +0000 (UTC) (envelope-from grog@lemis.com) Received: from wantadilla.lemis.com (wantadilla.lemis.com [192.109.197.135]) by ext-gw.lemis.com (Postfix) with ESMTP id D70C8133BDC; Wed, 28 Feb 2007 17:13:34 +1030 (CST) Received: by wantadilla.lemis.com (Postfix, from userid 1004) id C5FFB1A9CBF; Wed, 28 Feb 2007 17:13:34 +1030 (CST) Date: Wed, 28 Feb 2007 17:13:34 +1030 From: Greg 'groggy' Lehey To: Kris Kennaway Message-ID: <20070228064334.GG8399@wantadilla.lemis.com> References: <200702272309.l1RN9Xum011236@repoman.freebsd.org> <20070227235843.GA59138@xor.obsecurity.org> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="8S1fMsFYqgBC+BN/" Content-Disposition: inline In-Reply-To: <20070227235843.GA59138@xor.obsecurity.org> User-Agent: Mutt/1.4.2.1i Organization: The FreeBSD Project Phone: +61-8-8388-8286 Fax: +61-8-8388-8725 Mobile: +61-418-838-708 VoIP: sip:0871270137@sip.internode.on.net WWW-Home-Page: http://www.FreeBSD.org/ X-PGP-Fingerprint: 9A1B 8202 BCCE B846 F92F 09AC 22E6 F290 507A 4223 Cc: cvs-src@FreeBSD.org, src-committers@FreeBSD.org, cvs-all@FreeBSD.org Subject: Re: cvs commit: src/share/man/man9 sleep.9 X-BeenThere: cvs-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: CVS commit messages for the entire tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 28 Feb 2007 06:43:36 -0000 --8S1fMsFYqgBC+BN/ Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Tuesday, 27 February 2007 at 18:58:43 -0500, Kris Kennaway wrote: > On Tue, Feb 27, 2007 at 11:09:32PM +0000, Greg Lehey wrote: > >>> -function >>> -does not work reliably if more than one thread is sleeping on the same address; >>> -in this case it is possible for an unrelated thread to be woken. >>> -This thread will ignore the wakeup, and the correct process will never be >>> -woken. >>> +function does not work reliably if unrelated threads are sleeping on the same >>> +address. >>> +In this case, if a wakeup for one group of threads is delivered to a member of >>> +another group, that thread will ignore the wakeup, and the correct thread will >>> +never be woken up. >>> +It is the programmer's responsibility to choose a unique >>> +.Fa chan >>> +value. >>> +In case of doubt, do not use >>> +.Fn wakeup_one . > > I don't like this recommendation, since it directs the programmer to > introduce potentially serious performance bottlenecks at the expense > of clear thinking about their code to avoid introducing the bug in the > first place. How would you address the case? Recall that we're talking here about two different programmers, and you don't even know who the second one is. It would be nice to have some mechanism like WITLESS to detect the problem, but I can't see how it would work. Greg -- See complete headers for address and phone numbers. --8S1fMsFYqgBC+BN/ Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.3 (FreeBSD) iD8DBQFF5SSWIubykFB6QiMRAqJkAJ9b53uZQBRxjohMBvkbhszDqfM2IACgj0W7 lpXln3j5x87NxI/6f6xbowg= =u/rY -----END PGP SIGNATURE----- --8S1fMsFYqgBC+BN/--